]> gitweb.factorcode.org Git - factor.git/commitdiff
classes: store implementors in hash-sets.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Mar 2013 18:29:50 +0000 (10:29 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 8 Mar 2013 18:29:50 +0000 (10:29 -0800)
core/classes/classes.factor
core/generic/generic.factor

index cc38c2a7f4a942e5ec3d41b62ac4e795daaf428f..6970f88767f57456c96b42c2022338c8cd6f784f 100644 (file)
@@ -3,6 +3,7 @@
 USING: accessors assocs combinators definitions graphs kernel
 make namespaces quotations sequences sets words words.symbol ;
 FROM: namespaces => set ;
+QUALIFIED: sets
 IN: classes
 
 ERROR: bad-inheritance class superclass ;
@@ -133,7 +134,7 @@ GENERIC: implementors ( class/classes -- seq )
 
 : class-usages ( class -- seq ) [ class-usage ] closure keys ;
 
-M: class implementors implementors-map get at keys ;
+M: class implementors implementors-map get at sets:members ;
 
 M: sequence implementors [ implementors ] gather ;
 
@@ -146,7 +147,7 @@ M: sequence implementors [ implementors ] gather ;
     dup class-uses update-map get remove-vertex ;
 
 : implementors-map+ ( class -- )
-    [ H{ } clone ] dip implementors-map get set-at ;
+    [ HS{ } clone ] dip implementors-map get set-at ;
 
 : implementors-map- ( class -- )
     implementors-map get delete-at ;
index 321016094fd871f63d5101686907835d8b4ceb64..72e17fbe8ac2c989ab48ef042da7b85adbc81419 100644 (file)
@@ -140,7 +140,7 @@ M: anonymous-intersection implementor-classes participants>> ;
     [ swap implementor-classes [ implementors-map get at ] map ] dip call ; inline
 
 : reveal-method ( method classes generic -- )
-    [ [ [ conjoin ] with each ] with-implementors ]
+    [ [ [ adjoin ] with each ] with-implementors ]
     [ [ set-at ] with-methods ]
     2bi ;
 
@@ -176,8 +176,8 @@ M: method forget*
                 ] keep eq?
                 [
                     [ [ delete-at ] with-methods ]
-                    [ [ [ delete-at ] with each ] with-implementors ] 2bi
-                    reset-caches
+                    [ [ [ delete ] with each ] with-implementors ]
+                    2bi reset-caches
                 ] [ 2drop ] if
             ] if
         ]