Fix $or
parent
3adaa7a18e
commit
6360df8c1b
|
@ -1,5 +1,6 @@
|
||||||
USING: definitions help help.markup kernel sequences tools.test
|
USING: definitions help help.markup kernel sequences tools.test
|
||||||
words parser namespaces assocs generic io.streams.string accessors ;
|
words parser namespaces assocs generic io.streams.string accessors
|
||||||
|
strings math ;
|
||||||
IN: help.markup.tests
|
IN: help.markup.tests
|
||||||
|
|
||||||
TUPLE: blahblah quux ;
|
TUPLE: blahblah quux ;
|
||||||
|
@ -15,3 +16,12 @@ TUPLE: blahblah quux ;
|
||||||
[ ] [ \ fooey print-topic ] unit-test
|
[ ] [ \ fooey print-topic ] unit-test
|
||||||
|
|
||||||
[ ] [ gensym print-topic ] unit-test
|
[ ] [ gensym print-topic ] unit-test
|
||||||
|
|
||||||
|
[ "a string" ]
|
||||||
|
[ [ { $or string } print-element ] with-string-writer ] unit-test
|
||||||
|
|
||||||
|
[ "a string or an integer" ]
|
||||||
|
[ [ { $or string integer } print-element ] with-string-writer ] unit-test
|
||||||
|
|
||||||
|
[ "a string, a fixnum, or an integer" ]
|
||||||
|
[ [ { $or string fixnum integer } print-element ] with-string-writer ] unit-test
|
||||||
|
|
|
@ -246,7 +246,7 @@ M: f ($instance)
|
||||||
: $or ( element -- )
|
: $or ( element -- )
|
||||||
dup length {
|
dup length {
|
||||||
{ 1 [ first ($instance) ] }
|
{ 1 [ first ($instance) ] }
|
||||||
{ 2 [ first2 [ ($instance) " or " print-element ] [ ($instance) ] bi ] }
|
{ 2 [ first2 [ ($instance) " or " print-element ] [ ($instance) ] bi* ] }
|
||||||
[
|
[
|
||||||
drop
|
drop
|
||||||
unclip-last
|
unclip-last
|
||||||
|
|
Loading…
Reference in New Issue