From 6114a9da06eb66c3d22326ed5b5d5217c23f1a6a Mon Sep 17 00:00:00 2001 From: slava Date: Tue, 7 Mar 2006 00:19:32 +0000 Subject: [PATCH] Conditional breakpoints --- library/tools/annotations.factor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/tools/annotations.factor b/library/tools/annotations.factor index df3492d804..8335ba44c9 100644 --- a/library/tools/annotations.factor +++ b/library/tools/annotations.factor @@ -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 ;