Handbook
Glossary
n&& ( quots n -- quot )
Factor handbook
»
The language
»
Combinators
»
Short-circuit combinators
Prev:
3|| ( obj1 obj2 obj3 quots -- ? )
Next:
n|| ( quots n -- quot )
Vocabulary
combinators
.
short-circuit
Inputs
quots
a sequence of quotations
n
an
integer
Outputs
quot
a
quotation
Word description
A macro that rewrites the code to pass
n
parameters from the stack to each quotation, evaluating the result in the same manner as
0&&
.
Definition
USING:
arrays
combinators
combinators.short-circuit.private
generalizations
kernel
sequences
;
IN:
combinators.short-circuit
MACRO:
n&&
( quots n -- quot )
[
[
[
f
]
]
2dip
swap
[
[
[
[
~quotation~
]
dip
]
dip
[
keeping
dup
not
]
2curry
compose
]
[
drop
[
[
drop
]
]
dip
[
ndrop
f
]
curry
compose
]
2bi
2array
]
with
map
]
[
[
nnip
]
curry
suffix
1array
]
bi
[
cond
]
3append
;