Fix crash with bad each-object usage
parent
2512729f78
commit
cc09f334ef
|
@ -23,3 +23,6 @@ TUPLE: testing x y z ;
|
||||||
] when*
|
] when*
|
||||||
] each
|
] each
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! Erg's bug
|
||||||
|
2 [ [ [ 3 throw ] instances ] must-fail ] times
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
! Copyright (C) 2005, 2007 Slava Pestov.
|
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: kernel continuations sequences arrays system ;
|
||||||
IN: memory
|
IN: memory
|
||||||
USING: arrays kernel sequences vectors system hashtables
|
|
||||||
kernel.private sbufs growable assocs namespaces quotations
|
|
||||||
math strings combinators ;
|
|
||||||
|
|
||||||
: (each-object) ( quot: ( obj -- ) -- )
|
: (each-object) ( quot: ( obj -- ) -- )
|
||||||
[ next-object dup ] swap [ drop ] while ; inline
|
[ next-object dup ] swap [ drop ] while ; inline
|
||||||
|
|
||||||
: each-object ( quot -- )
|
: each-object ( quot -- )
|
||||||
begin-scan (each-object) end-scan ; inline
|
begin-scan [ (each-object) ] [ end-scan ] [ ] cleanup ; inline
|
||||||
|
|
||||||
: instances ( quot -- seq )
|
: instances ( quot -- seq )
|
||||||
pusher >r each-object r> >array ; inline
|
pusher [ each-object ] dip >array ; inline
|
||||||
|
|
||||||
: save ( -- ) image save-image ;
|
: save ( -- ) image save-image ;
|
||||||
|
|
Loading…
Reference in New Issue