Handbook
Glossary
breakpoint-if ( word quot: ( ... -- ... ? ) -- )
Factor handbook
»
UI developer tools
»
UI walker
»
Setting breakpoints
Prev:
breakpoint ( word -- )
Next:
breakpoint-after ( word n -- )
Vocabulary
tools
.
walker
Inputs
word
a
word
quot
a
quotation
with stack effect
( ... -- ... ? )
Outputs
None
Word description
Annotates a word definition to enter the single stepper if the quotation yields true. The quotation has access to the datastack as it exists just before
word
is called. Use
reset
to clear.
Examples
Break if the input to sq is 3:
USE: tools.walker \ sq [ dup 3 = ] breakpoint-if
Definition
USING:
kernel
sequences
tools.annotations
tools.continuations
;
IN:
tools.walker
:
breakpoint-if
( word quot: ( ... -- ... ? ) -- )
[
[
[
break
]
when
]
]
curry
[
dip
3append
]
curry
annotate
;