Handbook
Glossary
filter-model ( model quot -- filter-model )
Vocabulary
models
.
combinators
Inputs
model
a
model
quot
quotation with stack effect ( a b -- c )
Outputs
filter-model
a
filter-model
Word description
Creates a model that uses the updates of another model only when they satisfy a given predicate
Definition
IN:
models.combinators
TUPLE:
filter-model
<
multi-model
quot
;
USING:
accessors
arrays
kernel
;
IN:
models.combinators
:
filter-model
( model quot -- filter-model )
[
1array
\
filter-model
<multi-model>
]
dip
>>quot
;
Methods
USING:
accessors
combinators
kernel
models
models.combinators
;
M:
filter-model
(model-changed)
[
value>>
]
dip
2dup
quot>>
( a -- ? )
call-effect
[
set-model
]
[
2drop
]
if
;