factor/basis/struct-arrays/prettyprint/prettyprint.factor

21 lines
585 B
Factor
Raw Normal View History

2009-08-26 19:22:51 -04:00
! (c)Joe Groff bsd license
USING: accessors arrays kernel prettyprint.backend
prettyprint.custom prettyprint.sections sequences struct-arrays ;
2009-08-26 19:09:02 -04:00
IN: struct-arrays.prettyprint
2009-08-26 19:22:51 -04:00
M: struct-array pprint-delims
drop \ struct-array{ \ } ;
M: struct-array >pprint-sequence
[ >array ] [ class>> ] bi prefix ;
2009-08-30 22:05:21 -04:00
: pprint-struct-array-pointer ( struct-array -- )
\ struct-array@
[ [ class>> pprint-word ] [ underlying>> pprint* ] [ length>> pprint* ] tri ]
pprint-prefix ;
2009-08-30 22:05:21 -04:00
M: struct-array pprint*
[ pprint-object ]
[ pprint-struct-array-pointer ] pprint-c-object ;
2009-08-26 19:22:51 -04:00