From 65eddbcc9050ec9928887b5c969d1fc4c2d67cd1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 10 May 2008 18:59:39 -0500 Subject: [PATCH] Fix point-free conversion with empty body --- extra/locals/locals-tests.factor | 6 ++++++ extra/locals/locals.factor | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/extra/locals/locals-tests.factor b/extra/locals/locals-tests.factor index 2df9ecb658..c5adaa5e5e 100755 --- a/extra/locals/locals-tests.factor +++ b/extra/locals/locals-tests.factor @@ -247,4 +247,10 @@ M:: fixnum next-method-test ( a -- b ) a call-next-method 1 + ; [ { 4 5 6 } ] [ no-with-locals-test ] unit-test +{ 3 0 } [| a b c | ] must-infer-as + +[ ] [ 1 [let | a [ ] | ] ] unit-test + +[ 3 ] [ 1 [let | a [ ] | 3 ] ] unit-test + [ ] [ 1 2 [let | a [ ] b [ ] | ] ] unit-test diff --git a/extra/locals/locals.factor b/extra/locals/locals.factor index e44a6d33c6..af4f1a77b6 100755 --- a/extra/locals/locals.factor +++ b/extra/locals/locals.factor @@ -116,7 +116,9 @@ UNION: special local quote local-word local-reader local-writer ; 2tri 3append >quotation ; : point-free ( quot args -- newquot ) - over empty? [ drop ] [ (point-free) ] if ; + over empty? + [ nip length \ drop >quotation ] + [ (point-free) ] if ; UNION: lexical local local-reader local-writer local-word ;