Fix dispatch bug found by mnestic

db4
Slava Pestov 2008-09-10 01:45:16 -05:00
parent a41addf689
commit 6a1e6d3c08
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
USING: arrays byte-arrays kernel kernel.private math memory
namespaces sequences tools.test math.private quotations
continuations prettyprint io.streams.string debugger assocs ;
continuations prettyprint io.streams.string debugger assocs
sequences.private ;
IN: kernel.tests
[ 0 ] [ f size ] unit-test
@ -118,7 +119,8 @@ IN: kernel.tests
[ total-failure-1 ] must-fail
! From combinators.lib
[ 1 1 2 2 3 3 ] [ 1 2 3 [ dup ] tri@ ] unit-test
[ 1 4 9 ] [ 1 2 3 [ sq ] tri@ ] unit-test
[ [ sq ] tri@ ] must-infer
[ 4 ] [ 1 { [ 1 ] [ 2 ] } dispatch sq ] unit-test

View File

@ -74,7 +74,7 @@ INSTANCE: immutable-sequence sequence
: set-array-nth ( elt n array -- )
swap 2 fixnum+fast set-slot ; inline
: dispatch ( n array -- ) array-nth (call) ;
: dispatch ( n array -- ) array-nth call ;
GENERIC: resize ( n seq -- newseq ) flushable