Handbook
Glossary
n|| ( quots n -- quot )
Factor handbook
»
The language
»
Combinators
»
Short-circuit combinators
Prev:
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 OR quotation.
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
]
2curry
compose
]
[
drop
[
nnip
]
curry
]
2bi
2array
]
with
map
]
[
[
[
drop
]
]
dip
[
ndrop
t
]
curry
compose
[
f
]
2array
suffix
1array
]
bi
[
cond
]
3append
;