]> gitweb.factorcode.org Git - factor.git/commitdiff
typed: prevent TYPED: definitions without types.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Mar 2013 18:09:34 +0000 (11:09 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Mar 2013 18:09:34 +0000 (11:09 -0700)
basis/typed/typed.factor

index f25686f7d8241503a5246af1cd52ccdf1a98d8e8..a658fbf44b8ce32f441c1641db1baa5541ba0c2e 100644 (file)
@@ -11,6 +11,7 @@ IN: typed
 ERROR: type-mismatch-error value expected-type word expected-types ;
 ERROR: input-mismatch-error < type-mismatch-error ;
 ERROR: output-mismatch-error < type-mismatch-error ;
+ERROR: no-types-specified word effect ;
 
 PREDICATE: typed-gensym < word "typed-gensym" word-prop >boolean ;
 PREDICATE: typed-word < word "typed-word" word-prop >boolean ;
@@ -142,7 +143,7 @@ MACRO: typed ( quot word effect -- quot' )
     dup {
         [ effect-in-types typed-stack-effect? ]
         [ effect-out-types typed-stack-effect? ]
-    } 1|| [ (typed-def) ] [ drop nip ] if ;
+    } 1|| [ (typed-def) ] [ nip no-types-specified ] if ;
 
 M: typed-word subwords
     [ call-next-method ]