]> gitweb.factorcode.org Git - factor.git/commitdiff
delegate: verify generics on protocol definition. Fixes #260.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Oct 2011 23:29:38 +0000 (16:29 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Oct 2011 23:31:15 +0000 (16:31 -0700)
basis/delegate/delegate.factor

index 1b0b9e3a355f4ecc70e8419fd79ad7b1c5d8c589..24b4de8497ce7e1d871fc58316ea9986c3a9a899 100644 (file)
@@ -155,9 +155,15 @@ M: consultation forget*
 : show-words ( wordlist' -- wordlist )
     [ dup second zero? [ first ] when ] map ;
 
+ERROR: not-a-generic word ;
+
+: check-generic ( generic -- )
+    dup generic? [ drop ] [ not-a-generic ] if ;
+
 PRIVATE>
 
 : define-protocol ( protocol wordlist -- )
+    dup [ check-generic ] each
     [ drop define-symbol ] [
         fill-in-depth
         [ forget-old-definitions ]