2008-06-24 11:40:55 -04:00
|
|
|
|
2008-08-26 21:40:19 -04:00
|
|
|
USING: kernel sequences math stack-checker effects accessors macros
|
2008-06-24 11:40:55 -04:00
|
|
|
combinators.short-circuit ;
|
|
|
|
|
|
|
|
IN: combinators.short-circuit.smart
|
|
|
|
|
2008-08-26 21:40:19 -04:00
|
|
|
<PRIVATE
|
2008-06-24 11:40:55 -04:00
|
|
|
|
2008-08-26 21:40:19 -04:00
|
|
|
: arity ( quots -- n )
|
|
|
|
first infer
|
|
|
|
dup terminated?>> [ "Cannot determine arity" throw ] when
|
|
|
|
effect-height neg 1+ ;
|
|
|
|
|
|
|
|
PRIVATE>
|
|
|
|
|
|
|
|
MACRO: && ( quots -- quot ) dup arity n&&-rewrite ;
|
|
|
|
|
|
|
|
MACRO: || ( quots -- quot ) dup arity n||-rewrite ;
|