]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/walker/debug/debug.factor
f2155ec125c9be8171f61a443618a5ca5a85dd37
[factor.git] / basis / tools / walker / debug / debug.factor
1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: concurrency.promises models tools.walker kernel
4 sequences concurrency.messaging locals continuations
5 threads namespaces namespaces.private assocs accessors ;
6 IN: tools.walker.debug
7
8 :: test-walker ( quot -- data )
9     [let | p [ <promise> ] |
10         [
11             H{ } clone >n
12
13             [
14                 p promise-fulfilled?
15                 [ drop ] [ p fulfill ] if
16                 2drop
17             ] show-walker-hook set
18
19             break
20
21             quot call
22         ] "Walker test" spawn drop
23
24         step-into-all
25         p ?promise
26         send-synchronous drop
27
28         p ?promise
29         variables>> walker-continuation swap at
30         value>> data>>
31     ] ;