{ 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
{ "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 ( -- )
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