take advantage of pprint-prefix in c-object-pointer prettyprinters

db4
Joe Groff 2009-08-31 19:56:36 -05:00
parent 3ea364bc80
commit 79be927371
3 changed files with 5 additions and 13 deletions

View File

@ -28,11 +28,7 @@ IN: classes.struct.prettyprint
[ [ \ S{ ] dip [ class ] [ struct>assoc ] bi \ } (pprint-tuple) ] ?pprint-tuple ;
: pprint-struct-pointer ( struct -- )
<block
\ S@ pprint-word
[ class pprint-word ]
[ >c-ptr pprint* ] bi
block> ;
\ S@ [ [ class pprint-word ] [ >c-ptr pprint* ] bi ] pprint-prefix ;
PRIVATE>

View File

@ -9,10 +9,7 @@ IN: specialized-arrays.direct.functor
<PRIVATE
: pprint-direct-array ( direct-array tag -- )
<block
pprint-word
[ underlying>> ] [ length>> ] bi [ pprint* ] bi@
block> ;
[ [ underlying>> ] [ length>> ] bi [ pprint* ] bi@ ] pprint-prefix ;
PRIVATE>

View File

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