factor/extra/tools/walker/debug/debug.factor

32 lines
793 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.
USING: concurrency.promises models tools.walker kernel
2008-02-21 00:13:31 -05:00
sequences concurrency.messaging locals continuations
2008-03-18 02:26:09 -04:00
threads namespaces namespaces.private assocs ;
2008-02-21 00:13:22 -05:00
IN: tools.walker.debug
2008-02-26 19:40:32 -05:00
:: test-walker ( quot -- data )
2008-03-18 02:26:09 -04:00
[let | p [ <promise> ] |
2008-02-21 02:25:59 -05:00
[
H{ } clone >n
2008-03-18 02:26:09 -04:00
[
p promise-fulfilled?
[ drop ] [ p fulfill ] if
2drop
] show-walker-hook set
2008-02-21 02:25:59 -05:00
break
2008-02-21 03:08:08 -05:00
2008-02-21 02:25:59 -05:00
quot call
] "Walker test" spawn drop
2008-02-21 00:13:22 -05:00
step-into-all
p ?promise
send-synchronous drop
2008-02-21 03:08:08 -05:00
p ?promise
2008-03-18 02:26:09 -04:00
thread-variables walker-continuation swap at
model-value continuation-data
2008-02-21 00:13:22 -05:00
] ;