]> gitweb.factorcode.org Git - factor.git/commitdiff
continuations: more use of check-instance.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 15 Jan 2020 18:52:34 +0000 (10:52 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 15 Jan 2020 18:52:34 +0000 (10:52 -0800)
core/continuations/continuations.factor

index bf32960d0f979fcd147f6b035619f73ce8da5257..577ae71aaf669451572db5439d032d70bc7cb419 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2003, 2011 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs combinators combinators.private kernel
-kernel.private make namespaces sequences vectors ;
+USING: accessors assocs classes combinators combinators.private
+kernel kernel.private make namespaces sequences vectors ;
 IN: continuations
 
 : with-datastack ( stack quot -- new-stack )
@@ -49,11 +49,10 @@ C: <continuation> continuation
 
 <PRIVATE
 
-ERROR: not-a-continuation object ;
-
 : >continuation< ( continuation -- data call retain name catch )
-    dup continuation? [ not-a-continuation ] unless
-    { [ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ] } cleave ; inline
+    continuation check-instance {
+        [ data>> ] [ call>> ] [ retain>> ] [ name>> ] [ catch>> ]
+    } cleave ; inline
 
 PRIVATE>