add smart-if to combinators.smart
parent
771488d87b
commit
b1f9b58781
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors fry generalizations kernel macros math.order
|
||||
stack-checker math ;
|
||||
stack-checker math sequences ;
|
||||
IN: combinators.smart
|
||||
|
||||
MACRO: drop-outputs ( quot -- quot' )
|
||||
|
|
@ -39,3 +39,9 @@ MACRO: append-outputs-as ( quot exemplar -- newquot )
|
|||
|
||||
MACRO: append-outputs ( quot -- seq )
|
||||
'[ _ { } append-outputs-as ] ;
|
||||
|
||||
MACRO: preserving ( quot -- )
|
||||
[ infer in>> length ] keep '[ _ ndup @ ] ;
|
||||
|
||||
MACRO: smart-if ( pred true false -- )
|
||||
'[ _ preserving _ _ if ] ; inline
|
||||
|
|
|
|||
Loading…
Reference in New Issue