]> gitweb.factorcode.org Git - factor.git/blob - basis/combinators/short-circuit/smart/smart.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / combinators / short-circuit / smart / smart.factor
1 USING: kernel sequences math stack-checker effects accessors
2 macros fry combinators.short-circuit ;
3 IN: combinators.short-circuit.smart
4
5 <PRIVATE
6
7 ERROR: cannot-determine-arity ;
8
9 : arity ( quots -- n )
10     first infer
11     dup terminated?>> [ cannot-determine-arity ] when
12     effect-height neg 1 + ;
13
14 PRIVATE>
15
16 MACRO: && ( quots -- quot ) dup arity '[ _ _ n&& ] ;
17
18 MACRO: || ( quots -- quot ) dup arity '[ _ _ n|| ] ;