diff --git a/basis/combinators/smart/smart-tests.factor b/basis/combinators/smart/smart-tests.factor index bd224919f9..afafd174d3 100644 --- a/basis/combinators/smart/smart-tests.factor +++ b/basis/combinators/smart/smart-tests.factor @@ -53,3 +53,9 @@ IN: combinators.smart.tests { 2 0 } [ [ + ] nullary ] must-infer-as { 2 2 } [ [ [ + ] nullary ] preserving ] must-infer-as + +: smart-if-test ( a b -- b ) + [ < ] [ swap - ] [ - ] smart-if ; + +[ 7 ] [ 10 3 smart-if-test ] unit-test +[ 16 ] [ 25 41 smart-if-test ] unit-test diff --git a/basis/combinators/smart/smart.factor b/basis/combinators/smart/smart.factor index cb1b309c86..05185fec2e 100644 --- a/basis/combinators/smart/smart.factor +++ b/basis/combinators/smart/smart.factor @@ -50,4 +50,4 @@ MACRO: nullary ( quot -- quot' ) dup outputs '[ @ _ ndrop ] ; MACRO: smart-if ( pred true false -- ) - '[ _ preserving _ _ if ] ; inline + '[ _ preserving _ _ if ] ;