combinators.lib: Add || variants

db4
Eduardo Cavazos 2008-05-28 21:44:02 -05:00
parent 299bb1fb16
commit 73b0e07277
1 changed files with 13 additions and 0 deletions

View File

@ -77,8 +77,21 @@ MACRO: <--&& ( quots -- )
[ [ 2dup ] prepend [ not ] append [ f ] ] t short-circuit
[ 2nip ] append ;
! or
MACRO: || ( quots -- ? ) [ [ t ] ] f short-circuit ;
MACRO: 0|| ( quots -- ? ) [ [ t ] ] f short-circuit ;
MACRO: 1|| ( quots -- ? )
[ [ dup ] prepend [ t ] ] f short-circuit [ nip ] append ;
MACRO: 2|| ( quots -- ? )
[ [ 2dup ] prepend [ t ] ] f short-circuit [ 2nip ] append ;
MACRO: 3|| ( quots -- ? )
[ [ 2dup ] prepend [ t ] ] f short-circuit [ 2nip ] append ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ifte
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!