factor/basis/tools/walker/debug/debug.factor

31 lines
723 B
Factor
Raw Normal View History

2008-02-21 00:13:22 -05:00
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2009-04-15 23:16:52 -04:00
USING: concurrency.promises models tools.walker tools.continuations
kernel sequences concurrency.messaging locals continuations threads
namespaces namespaces.private assocs accessors ;
2008-02-21 00:13:22 -05:00
IN: tools.walker.debug
2008-02-26 19:40:32 -05:00
:: test-walker ( quot -- data )
2009-10-27 22:50:31 -04:00
<promise> :> p
[
H{ } clone >n
2008-03-18 02:26:09 -04:00
2009-10-27 22:50:31 -04:00
[
p promise-fulfilled?
[ drop ] [ p fulfill ] if
2drop
] show-walker-hook set
2008-02-21 02:25:59 -05:00
2009-10-27 22:50:31 -04:00
break
2008-02-21 03:08:08 -05:00
2009-10-27 22:50:31 -04:00
quot call
] "Walker test" spawn drop
2008-02-21 00:13:22 -05:00
2009-10-27 22:50:31 -04:00
step-into-all
p ?promise
send-synchronous drop
2008-02-21 00:13:22 -05:00
2009-10-27 22:50:31 -04:00
p ?promise
variables>> walker-continuation swap at
value>> data>> ;