]> gitweb.factorcode.org Git - factor.git/blob - basis/combinators/short-circuit/smart/smart.factor
b80e7294d15e064c926a36a09ff732c2cb1eaebe
[factor.git] / basis / combinators / short-circuit / smart / smart.factor
1 USING: kernel sequences math stack-checker effects accessors macros
2 fry combinators.short-circuit ;
3 IN: combinators.short-circuit.smart
4
5 <PRIVATE
6
7 : arity ( quots -- n )
8     first infer
9     dup terminated?>> [ "Cannot determine arity" throw ] when
10     effect-height neg 1+ ;
11
12 PRIVATE>
13
14 MACRO: && ( quots -- quot ) dup arity '[ _ _ n&& ] ;
15
16 MACRO: || ( quots -- quot ) dup arity '[ _ _ n|| ] ;