pprint S@, X-array@ in <block block> for better formatting

db4
Joe Groff 2009-08-30 21:12:02 -05:00
parent ab3ec291cd
commit e1e457c27e
3 changed files with 12 additions and 5 deletions

View File

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

View File

@ -2,14 +2,17 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: functors sequences sequences.private kernel words classes USING: functors sequences sequences.private kernel words classes
math alien alien.c-types byte-arrays accessors math alien alien.c-types byte-arrays accessors
specialized-arrays parser prettyprint.backend prettyprint.custom ; specialized-arrays parser
prettyprint.backend prettyprint.custom prettyprint.sections ;
IN: specialized-arrays.direct.functor IN: specialized-arrays.direct.functor
<PRIVATE <PRIVATE
: pprint-direct-array ( direct-array tag -- ) : pprint-direct-array ( direct-array tag -- )
<block
pprint-word pprint-word
[ underlying>> ] [ length>> ] bi [ pprint* ] bi@ ; [ underlying>> ] [ length>> ] bi [ pprint* ] bi@
block> ;
PRIVATE> PRIVATE>

View File

@ -1,6 +1,6 @@
! (c)Joe Groff bsd license ! (c)Joe Groff bsd license
USING: accessors arrays kernel prettyprint.backend USING: accessors arrays kernel prettyprint.backend
prettyprint.custom sequences struct-arrays ; prettyprint.custom prettyprint.sections sequences struct-arrays ;
IN: struct-arrays.prettyprint IN: struct-arrays.prettyprint
M: struct-array pprint-delims M: struct-array pprint-delims
@ -10,8 +10,10 @@ M: struct-array >pprint-sequence
[ >array ] [ class>> ] bi prefix ; [ >array ] [ class>> ] bi prefix ;
: pprint-struct-array-pointer ( struct-array -- ) : pprint-struct-array-pointer ( struct-array -- )
<block
\ struct-array@ pprint-word \ struct-array@ pprint-word
[ class>> ] [ underlying>> ] [ length>> ] tri [ pprint* ] tri@ ; [ class>> ] [ underlying>> ] [ length>> ] tri [ pprint* ] tri@
block> ;
M: struct-array pprint* M: struct-array pprint*
[ pprint-object ] [ pprint-object ]