sequences: Fix tests that broke when nth could only be integers. Undo integer>fixnum in iota nth. See bug #582.

db4
Doug Coleman 2012-07-25 22:15:17 -07:00
parent 68f8d5bc17
commit 2996ef41ff
4 changed files with 5 additions and 6 deletions

View File

@ -357,13 +357,13 @@ cell-bits 32 = [
[ f ] [ [ f ] [
[ [
{ integer } declare iota [ ] map { integer } declare iota [ ] map
] \ >fixnum inlined? ] \ integer>fixnum inlined?
] unit-test ] unit-test
[ f ] [ [ f ] [
[ [
{ integer } declare { } set-nth-unsafe { integer } declare { } set-nth-unsafe
] \ >fixnum inlined? ] \ integer>fixnum inlined?
] unit-test ] unit-test
[ f ] [ [ f ] [

View File

@ -20,7 +20,7 @@ must-fail
[ most-positive-fixnum 2 * 2 + V{ } clone set-length ] [ most-positive-fixnum 2 * 2 + V{ } clone set-length ]
must-fail must-fail
[ ] [ [
10 V{ } [ set-length ] keep 10 V{ } [ set-length ] keep
0.5 swap set-length 0.5 swap set-length
] unit-test ] must-fail

View File

@ -214,7 +214,6 @@ unit-test
[ V{ "a" "b" } V{ } ] [ { "X" "a" "b" } { "X" } drop-prefix [ >vector ] bi@ ] unit-test [ V{ "a" "b" } V{ } ] [ { "X" "a" "b" } { "X" } drop-prefix [ >vector ] bi@ ] unit-test
[ 0.5 10 iota nth ] [ no-method? ] must-fail-with
[ 0.5 { 1 2 3 } nth ] [ no-method? ] must-fail-with [ 0.5 { 1 2 3 } nth ] [ no-method? ] must-fail-with
[ 0.5 "asdfasdf" nth ] [ no-method? ] must-fail-with [ 0.5 "asdfasdf" nth ] [ no-method? ] must-fail-with

View File

@ -106,7 +106,7 @@ TUPLE: iota { n integer read-only } ;
: iota ( n -- iota ) \ iota boa ; inline : iota ( n -- iota ) \ iota boa ; inline
M: iota length n>> ; inline M: iota length n>> ; inline
M: iota nth-unsafe drop integer>fixnum ; inline M: iota nth-unsafe drop ; inline
INSTANCE: iota immutable-sequence INSTANCE: iota immutable-sequence