]> gitweb.factorcode.org Git - factor.git/commitdiff
make direct-*-arrays prettyprint
authorJoe Groff <joe@victoria.(none)>
Thu, 13 Aug 2009 16:05:46 +0000 (12:05 -0400)
committerJoe Groff <joe@victoria.(none)>
Thu, 13 Aug 2009 16:05:46 +0000 (12:05 -0400)
basis/specialized-arrays/direct/functor/functor.factor

index e7e891feded042d1fb371aa9a0ac9f936281d1d1..b49dfa35e415ce400fd9de2bbbd866214ff17f8c 100755 (executable)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: functors sequences sequences.private kernel words classes
 math alien alien.c-types byte-arrays accessors
-specialized-arrays ;
+specialized-arrays prettyprint.custom ;
 IN: specialized-arrays.direct.functor
 
 FUNCTOR: define-direct-array ( T -- )
@@ -10,6 +10,7 @@ FUNCTOR: define-direct-array ( T -- )
 A'      IS ${T}-array
 >A'     IS >${T}-array
 <A'>    IS <${A'}>
+A'{     IS ${A'}{
 
 A       DEFINES-CLASS direct-${T}-array
 <A>     DEFINES <${A}>
@@ -30,6 +31,12 @@ M: A set-nth-unsafe underlying>> SET-NTH call ;
 M: A like drop dup A instance? [ >A' ] unless ;
 M: A new-sequence drop <A'> ;
 
+M: A pprint-delims drop \ A'{ \ } ;
+
+M: A >pprint-sequence ;
+
+M: A pprint* pprint-object ;
+
 INSTANCE: A sequence
 
 ;FUNCTOR