]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.trace: we can surely hardcode the excluded vocab list
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 23 Jun 2017 22:14:52 +0000 (00:14 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Fri, 23 Jun 2017 22:14:52 +0000 (00:14 +0200)
basis/tools/trace/trace-tests.factor
basis/tools/trace/trace.factor

index 335f37331ad3d990b572098c106d495772f71f7f..b221e9fc3b19c280ceedd883e62ba67b6ddd232f 100644 (file)
@@ -1,6 +1,6 @@
 IN: tools.trace.tests
-USING: tools.trace tools.test tools.continuations kernel math combinators
-sequences ;
+USING: combinators kernel math sequences tools.continuations
+tools.test tools.trace tools.trace.private ;
 
 { { 3 2 1 } } [ { 1 2 3 } [ reverse ] trace ] unit-test
 
@@ -22,9 +22,15 @@ M: method-breakpoint-tuple method-breakpoint-test break drop 1 2 + ;
 
 { 6 } [ [ case-breakpoint-test ] trace ] unit-test
 
-: call(-breakpoint-test ( -- x )
+: call-op-para-breakpoint-test ( -- x )
     [ break 1 ] call( -- x ) 2 + ;
 
-\ call(-breakpoint-test don't-step-into
+\ call-op-para-breakpoint-test don't-step-into
 
-{ 3 } [ [ call(-breakpoint-test ] trace ] unit-test
+{ 3 } [ [ call-op-para-breakpoint-test ] trace ] unit-test
+
+{ f t t } [
+    \ + into?
+    \ dip into?
+    \ sq into?
+] unit-test
index 21107fa0425e1e43b0d6232c998e7206473affb4..57f2adb4b49e41dd7373d59bf862d208b75615a3 100644 (file)
@@ -1,17 +1,11 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: concurrency.promises models tools.continuations kernel
-sequences concurrency.messaging locals continuations threads
-namespaces namespaces.private make assocs accessors io strings
-prettyprint math math.parser words effects summary io.styles classes
-generic.math combinators.short-circuit kernel.private quotations ;
+USING: accessors classes combinators.short-circuit effects
+generic.math io io.styles kernel kernel.private make math.parser
+namespaces prettyprint quotations sequences strings summary
+tools.continuations words ;
 IN: tools.trace
 
-SYMBOL: exclude-vocabs
-SYMBOL: include-vocabs
-
-exclude-vocabs { "math" "accessors" } swap set-global
-
 <PRIVATE
 
 : callstack-depth ( callstack -- n )
@@ -19,27 +13,14 @@ exclude-vocabs { "math" "accessors" } swap set-global
 
 SYMBOL: end
 
-: include? ( vocab -- ? )
-    include-vocabs get [ member? ] [ drop t ] if* ;
-
-: exclude? ( vocab -- ? )
-    exclude-vocabs get [ member? ] [ drop f ] if* ;
-
 : into? ( obj -- ? )
     {
         [ word? ]
         [ predicate? not ]
         [ math-generic? not ]
         [
-            {
-                [ inline? ]
-                [
-                    {
-                        [ vocabulary>> include? ]
-                        [ vocabulary>> exclude? not ]
-                    } 1&&
-                ]
-            } 1||
+            [ inline? ]
+            [ vocabulary>> { "math" "accessors" } member? not ] bi or
         ]
     } 1&& ;