Hello,

Here are non-recursive versions of 0||, 1||, 0&&, and 1&&. They expand 
into 'cond':

MACRO: 0|| ( quots -- quot )
  [ '[ drop @ dup ] [ ] {2} ] map
  { [ drop t ] [ f ] }        suffix
  '[ f , cond ] ;

MACRO: 1|| ( quots -- quot )
  [ '[ drop dup @ dup ] [ nip ] {2} ] map
  { [ drop drop t ] [ f ] }           suffix
  '[ f , cond ] ;

MACRO: 0&& ( quots -- quot )
  [ '[ drop @ dup not ] [ drop f ] {2} ] map
  { [ t ] [ ] }                          suffix
  '[ f , cond ] ;

MACRO: 1&& ( quots -- quot )
  [ '[ drop dup @ dup not ] [ drop drop f ] {2} ] map
  { [ t ] [ nip ] }                               suffix
  '[ f , cond ] ;

Ed

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to