From 39eb4b06ec8a1ad9886d79ce99828d82f4cbce0e Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 23 Mar 2013 16:36:22 -0700 Subject: [PATCH] iota: iota vs iota-tuple. Sorry...for the tools to work! --- core/sequences/sequences-tests.factor | 2 +- core/sequences/sequences.factor | 11 ++++++----- core/sorting/sorting-tests.factor | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index 34bf2abdba..70bd01fb98 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -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 ] [ diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 4765de956b..e496e55c24 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -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