iota: iota vs iota-tuple. Sorry...for the tools to work!
parent
b4acfa376a
commit
39eb4b06ec
|
@ -314,7 +314,7 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ;
|
|||
|
||||
[ "asdf" iota ] must-fail
|
||||
[ -1 iota ] must-fail
|
||||
[ T{ iota { n 10 } } ] [ 10 iota ] unit-test
|
||||
[ T{ iota-tuple { n 10 } } ] [ 10 iota ] unit-test
|
||||
[ 0 ] [ 10 iota first ] unit-test
|
||||
|
||||
[ "hi" 3 ] [
|
||||
|
|
|
@ -102,17 +102,18 @@ M: f like drop [ f ] when-empty ; inline
|
|||
INSTANCE: f immutable-sequence
|
||||
|
||||
! Integer sequences
|
||||
TUPLE: iota { n integer read-only } ;
|
||||
TUPLE: iota-tuple { n integer read-only } ;
|
||||
|
||||
ERROR: non-negative-integer-expected n ;
|
||||
|
||||
: iota ( n -- iota )
|
||||
dup 0 < [ non-negative-integer-expected ] when \ iota boa ; inline
|
||||
dup 0 < [ non-negative-integer-expected ] when
|
||||
\ iota-tuple boa ; inline
|
||||
|
||||
M: iota length n>> ; inline
|
||||
M: iota nth-unsafe drop ; inline
|
||||
M: iota-tuple length n>> ; inline
|
||||
M: iota-tuple nth-unsafe drop ; inline
|
||||
|
||||
INSTANCE: iota immutable-sequence
|
||||
INSTANCE: iota-tuple immutable-sequence
|
||||
|
||||
<PRIVATE
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ IN: sorting.tests
|
|||
[ { } ] [ { } natural-sort ] unit-test
|
||||
|
||||
[ { 270000000 270000001 } ]
|
||||
[ T{ slice f 270000000 270000002 T{ iota f 270000002 } } natural-sort ]
|
||||
[ T{ slice f 270000000 270000002 T{ iota-tuple f 270000002 } } natural-sort ]
|
||||
unit-test
|
||||
|
||||
[ t ] [
|
||||
|
|
Loading…
Reference in New Issue