From a5d0705b48bbb69a0ccd6d09b95aee02b85d2df2 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 8 Nov 2009 21:00:35 -0600 Subject: [PATCH] patch up locals fry tests --- basis/fry/fry.factor | 5 ++++- basis/locals/locals-tests.factor | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/basis/fry/fry.factor b/basis/fry/fry.factor index 60c76b726f..931397e933 100644 --- a/basis/fry/fry.factor +++ b/basis/fry/fry.factor @@ -38,12 +38,15 @@ INSTANCE: fried-callable fried [ [ \ 3curry suffix! ] dip 3 - (ncurry) ] } case ; +: wrap-non-callable ( obj -- quot ) + dup callable? [ ] [ [ call ] curry ] if ; inline + : [ncurry] ( n -- quot ) [ V{ } clone ] dip (ncurry) >quotation ; : [ndip] ( quot n -- quot' ) { - { 0 [ ] } + { 0 [ wrap-non-callable ] } { 1 [ \ dip [ ] 2sequence ] } { 2 [ \ 2dip [ ] 2sequence ] } { 3 [ \ 3dip [ ] 2sequence ] } diff --git a/basis/locals/locals-tests.factor b/basis/locals/locals-tests.factor index 581ed5de33..7aa8032cdd 100644 --- a/basis/locals/locals-tests.factor +++ b/basis/locals/locals-tests.factor @@ -389,7 +389,7 @@ M:: integer lambda-method-forget-test ( a -- b ) a ; eval( -- ) call ] [ error>> >r/r>-in-fry-error? ] must-fail-with -:: (funny-macro-test) ( obj quot -- ? ) obj { quot } 1&& ; inline +:: (funny-macro-test) ( obj quot -- ? ) obj { [ quot call ] } 1&& ; inline : funny-macro-test ( n -- ? ) [ odd? ] (funny-macro-test) ; \ funny-macro-test def>> must-infer