]> gitweb.factorcode.org Git - factor.git/commitdiff
update classes.struct tests, and make struct prettyprinting work again
authorJoe Groff <arcata@gmail.com>
Tue, 1 Sep 2009 01:46:33 +0000 (20:46 -0500)
committerJoe Groff <arcata@gmail.com>
Tue, 1 Sep 2009 01:46:33 +0000 (20:46 -0500)
basis/classes/struct/prettyprint/prettyprint.factor
basis/classes/struct/struct-tests.factor

index 253f90442083fad9bc8a5e7f59d77072986f2574..d9d2a6f677c3ac4993af40fec0766c3a5a8fe882 100644 (file)
@@ -27,7 +27,12 @@ IN: classes.struct.prettyprint
     \ } pprint-word block> ;
 
 : pprint-struct ( struct -- )
-    [ [ \ S{ ] dip [ class ] [ struct>assoc ] bi \ } (pprint-tuple) ] ?pprint-tuple ;
+    [
+        [ \ S{ ] dip
+        [ class ]
+        [ struct>assoc [ [ name>> ] dip ] assoc-map ] bi
+        \ } (pprint-tuple)
+    ] ?pprint-tuple ;
 
 : pprint-struct-pointer ( struct -- )
     \ S@ [ [ class pprint-word ] [ >c-ptr pprint* ] bi ] pprint-prefix ;
index b31d8473ab89030a5a2076ffc9686b4a75e51281..55f67c398bdcf4012ab14080135c57a1bd881645 100644 (file)
@@ -76,7 +76,7 @@ STRUCT: struct-test-string-ptr
     ] with-destructors
 ] unit-test
 
-[ "S{ struct-test-foo { y 7654 } }" ]
+[ "S{ struct-test-foo { x 0 } { y 7654 } { z f } }" ]
 [
     [
         boa-tuples? off