struct-array@ syntax

db4
Joe Groff 2009-08-30 21:05:21 -05:00
parent 82025bde30
commit ab3ec291cd
2 changed files with 10 additions and 1 deletions

View File

@ -9,5 +9,11 @@ M: struct-array pprint-delims
M: struct-array >pprint-sequence
[ >array ] [ class>> ] bi prefix ;
M: struct-array pprint* pprint-object ;
: pprint-struct-array-pointer ( struct-array -- )
\ struct-array@ pprint-word
[ class>> ] [ underlying>> ] [ length>> ] tri [ pprint* ] tri@ ;
M: struct-array pprint*
[ pprint-object ]
[ pprint-struct-array-pointer ] pprint-c-object ;

View File

@ -71,6 +71,9 @@ M: struct-type <c-direct-array> ( alien len c-type -- array )
SYNTAX: struct-array{
\ } scan-word [ >struct-array ] curry parse-literal ;
SYNTAX: struct-array@
scan-word [ scan-object scan-object ] dip <direct-struct-array> parsed ;
USING: vocabs vocabs.loader ;
"prettyprint" vocab [ "struct-arrays.prettyprint" require ] when