]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/delegate/delegate.factor
classes: use check-instance in a few places, to remove duplication.
[factor.git] / basis / delegate / delegate.factor
index 06d52832249744a64743eee59d24db8d592e0fc3..1554616c787259fedd5fa01cc06ac3c2a476f996 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2007, 2008 Daniel Ehrenberg
 ! Portions copyright (C) 2009, 2010 Slava Pestov, Joe Groff
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes.tuple definitions effects generic
-generic.standard hashtables kernel lexer math parser
-generic.parser sequences sets slots words words.symbol fry
-compiler.units make ;
+USING: accessors arrays assocs classes classes.tuple
+compiler.units definitions effects fry generic generic.standard
+hashtables kernel lexer make math parser sequences sets slots
+words words.symbol ;
 IN: delegate
 
 ERROR: broadcast-words-must-have-no-outputs group ;
@@ -159,11 +159,8 @@ M: consultation forget*
 : show-words ( wordlist' -- wordlist )
     [ dup second zero? [ first ] when ] map ;
 
-ERROR: not-a-generic word ;
-
 : check-generic ( generic -- )
-    dup array? [ first ] when
-    dup generic? [ drop ] [ not-a-generic ] if ;
+    dup array? [ first ] when generic check-instance drop ;
 
 PRIVATE>