diff --git a/basis/combinators/smart/smart-tests.factor b/basis/combinators/smart/smart-tests.factor index c7c11401c9..0a28c0ea83 100644 --- a/basis/combinators/smart/smart-tests.factor +++ b/basis/combinators/smart/smart-tests.factor @@ -82,3 +82,7 @@ IN: combinators.smart.tests :: map-reduce-test ( a b c -- d ) [ a b c ] [ a - ] [ b * + ] map-reduce-outputs ; [ ] [ 1 2 3 map-reduce-test ] unit-test + +[ ( x x -- x ) ] [ [ curry inputs ] infer ] unit-test + +[ ( x -- x ) ] [ [ [ curry ] curry inputs ] infer ] unit-test diff --git a/basis/combinators/smart/smart.factor b/basis/combinators/smart/smart.factor index d36fc56557..9742ca72a2 100644 --- a/basis/combinators/smart/smart.factor +++ b/basis/combinators/smart/smart.factor @@ -30,19 +30,22 @@ GENERIC: infer-known* ( known -- effect ) ] if* ] "special" set-word-prop -! TODO: Handle the case where a nested call to infer-known returns f - M: curried infer-known* - quot>> infer-known curry-effect ; + quot>> infer-known dup [ + curry-effect + ] [ + drop f + ] if ; M: composed infer-known* [ quot1>> ] [ quot2>> ] bi - [ infer-known ] bi@ compose-effects ; + [ infer-known ] bi@ + 2dup and [ compose-effects ] [ 2drop f ] if ; M: declared-effect infer-known* known>> infer-known* ; -M: input-parameter infer-known* \ inputs/outputs unknown-macro-input ; +M: input-parameter infer-known* drop f ; M: object infer-known* drop f ;