]> gitweb.factorcode.org Git - factor.git/commitdiff
classes: optimize instance? for classoids
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 23 Nov 2011 04:38:07 +0000 (20:38 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 23 Nov 2011 04:38:07 +0000 (20:38 -0800)
basis/compiler/tree/propagation/known-words/known-words.factor
basis/compiler/tree/propagation/transforms/transforms.factor
core/classes/maybe/maybe.factor

index 78307887b7c135b15777f6bf4f299ad783ea0d85..617bd1ceab422368313bd76889be28e0cb197d6f 100644 (file)
@@ -302,7 +302,7 @@ generic-comparison-ops [
 ] "outputs" set-word-prop
 
 \ instance? [
-    [ value-info ] dip over literal>> class? [
+    [ value-info ] dip over literal>> classoid? [
         [ literal>> ] dip predicate-constraints
     ] [ 3drop f ] if
 ] "constraints" set-word-prop
@@ -311,10 +311,10 @@ generic-comparison-ops [
     ! We need to force the caller word to recompile when the class
     ! is redefined, since now we're making assumptions but the
     ! class definition itself.
-    dup literal>> class?
+    dup literal>> classoid?
     [
         literal>>
-        [ depends-on-conditionally ]
+        [ depends-on-class ]
         [ predicate-output-infos ]
         bi
     ] [ 2drop object-info ] if
index d1a5fa9a1f6c6a4e4f14e98d02af63910776e7a0..3b387a2254becb89a7674e4432571ce95cfa3777 100644 (file)
@@ -177,7 +177,7 @@ ERROR: bad-partial-eval quot word ;
 \ new [ inline-new ] 1 define-partial-eval
 
 \ instance? [
-    dup class?
+    dup classoid?
     [ predicate-def ] [ drop f ] if
 ] 1 define-partial-eval
 
index 30c09e923701d5b6b9e2098e62435c73244cc64e..37adf2331da2834352a69fca8400242d07d2e49d 100644 (file)
@@ -32,3 +32,6 @@ M: maybe union-of-builtins?
 
 M: maybe class-name
     class>> name>> ;
+
+M: maybe predicate-def
+    class>> predicate-def [ [ t ] if* ] curry ;