Fix point-free conversion with empty body

db4
Slava Pestov 2008-05-10 18:59:39 -05:00
parent 849b4a062c
commit 65eddbcc90
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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 <repetition> >quotation ]
[ (point-free) ] if ;
UNION: lexical local local-reader local-writer local-word ;