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
{ 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
! 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 )
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&& ;