]> gitweb.factorcode.org Git - factor.git/commitdiff
custom inlining for diff and intersect, when given a literal sequence. this cuts...
authorDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Thu, 5 Nov 2009 19:13:27 +0000 (13:13 -0600)
committerDaniel Ehrenberg <littledan@pool-224-36.res.carleton.edu>
Thu, 5 Nov 2009 19:13:27 +0000 (13:13 -0600)
basis/compiler/tree/propagation/transforms/transforms.factor

index 1f40bf00a2f07c77016c8d0a98529ee927df238d..ff68fb2400a97a345afb744373d61bc06b39da4c 100644 (file)
@@ -3,7 +3,7 @@
 USING: kernel sequences words fry generic accessors
 classes.tuple classes classes.algebra definitions
 stack-checker.state quotations classes.tuple.private math
-math.partial-dispatch math.private math.intervals
+math.partial-dispatch math.private math.intervals sets.private
 math.floats.private math.integers.private layouts math.order
 vectors hashtables combinators effects generalizations assocs
 sets combinators.short-circuit sequences.private locals
@@ -290,3 +290,13 @@ CONSTANT: lookup-table-at-max 256
     ] [ drop f ] if ;
 
 \ at* [ at-quot ] 1 define-partial-eval
+
+: diff-quot ( seq -- quot: ( seq' -- seq'' ) )
+    tester '[ [ @ not ] filter ] ;
+
+\ diff [ diff-quot ] 1 define-partial-eval
+
+: intersect-quot ( seq -- quot: ( seq' -- seq'' ) )
+    tester '[ _ filter ] ;
+
+\ intersect [ intersect-quot ] 1 define-partial-eval