]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.scaffold: generating docs for obj/f was broken.
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 6 May 2015 02:12:36 +0000 (19:12 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 6 May 2015 04:39:55 +0000 (21:39 -0700)
basis/tools/scaffold/scaffold-tests.factor
basis/tools/scaffold/scaffold.factor

index 992a2f6a4560cc0212769ac196d55242dee21c02..2ba224cb90869ba1fec1a17bf3d108f0fc188f74 100644 (file)
@@ -25,3 +25,8 @@ IN: tools.scaffold.tests
 { sequence t } [ "newseq" lookup-type ] unit-test
 { { $maybe sequence } t } [ "seq/f" lookup-type ] unit-test
 { f f } [ "foo" lookup-type ] unit-test
+
+
+: test-maybe ( obj -- obj/f ) ;
+
+[ ] [ \ test-maybe (help.) ] unit-test
\ No newline at end of file
index 326aef5cba3614c81c1061aa3d1747fcc8d1f528..8f1aeed56a4846362380d156af47f7d492c8607b 100644 (file)
@@ -146,7 +146,13 @@ ERROR: vocab-name-contains-dot path ;
         { "url" url }
     } at* [ swap [ \ $maybe swap 2array ] when ] dip ;
 
-: add-using ( object -- )
+GENERIC: add-using ( object -- )
+
+M: array add-using [ add-using ] each ;
+
+M: string add-using drop ;
+
+M: object add-using ( object -- )
     vocabulary>> using get [ adjoin ] [ drop ] if* ;
 
 : 4bl ( -- )
@@ -160,7 +166,7 @@ ERROR: vocab-name-contains-dot path ;
             dup array? [ first ] when
             dup lookup-type [
                 [ unparse write bl ]
-                [ [ pprint ] [ dup string? [ drop ] [ add-using ] if ] bi ] bi*
+                [ [ pprint ] [ add-using ] bi ] bi*
             ] [
                 drop unparse write bl null pprint
                 null add-using