]> gitweb.factorcode.org Git - factor.git/commitdiff
typed: factor typed-def? out of typed-def.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 12 May 2016 23:33:19 +0000 (16:33 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 12 May 2016 23:33:19 +0000 (16:33 -0700)
basis/typed/typed.factor

index 4a14e5d3b72e263ce92d5e7aebb424853d6f66aa..e8bdb4631200e704700f5f94c4935baacac21664 100644 (file)
@@ -139,11 +139,15 @@ MACRO: typed ( quot word effect -- quot' )
     [ drop [ swap "typed-word" set-word-prop ] [ [ 1quotation ] dip ] 2bi ] dip
     [ typed ] 3curry ;
 
-: typed-def ( word def effect -- quot )
-    dup {
+: typed-def? ( effect -- quot )
+    {
         [ effect-in-types typed-stack-effect? ]
         [ effect-out-types typed-stack-effect? ]
-    } 1|| [ (typed-def) ] [ nip no-types-specified ] if ;
+    } 1|| ;
+
+: typed-def ( word def effect -- quot )
+    dup typed-def?
+    [ (typed-def) ] [ nip no-types-specified ] if ;
 
 M: typed-word subwords
     [ call-next-method ]