continuations: more use of check-instance.
parent
77cd3aaede
commit
19c8d482fb
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2003, 2011 Slava Pestov.
|
! Copyright (C) 2003, 2011 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs combinators combinators.private kernel
|
USING: accessors assocs classes combinators combinators.private
|
||||||
kernel.private make namespaces sequences vectors ;
|
kernel kernel.private make namespaces sequences vectors ;
|
||||||
IN: continuations
|
IN: continuations
|
||||||
|
|
||||||
: with-datastack ( stack quot -- new-stack )
|
: with-datastack ( stack quot -- new-stack )
|
||||||
|
@ -49,11 +49,10 @@ C: <continuation> continuation
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
ERROR: not-a-continuation object ;
|
|
||||||
|
|
||||||
: >continuation< ( continuation -- data call retain name catch )
|
: >continuation< ( continuation -- data call retain name catch )
|
||||||
dup continuation? [ not-a-continuation ] unless
|
continuation check-instance {
|
||||||
{ [ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ] } cleave ; inline
|
[ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ]
|
||||||
|
} cleave ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue