Conditional breakpoints

release
slava 2006-03-07 00:19:32 +00:00
parent 48ff54c399
commit 6114a9da06
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,13 @@ sequences strings walker ;
: break ( word -- )
#! Cause the word to start the code walker when executed.
[ nip [ walk ] cons ] annotate ;
[ nip [ walk ] curry ] annotate ;
: break-on ( word test -- | test: -- ? )
#! Conditional breakpoint.
swap [
nip [ swap % dup [ walk ] curry , , \ if , ] [ ] make
] annotate ;
: with-profile ( quot word -- )
millis >r >r call r> millis r> - swap global [ +@ ] bind ;