Fix point-free conversion with empty body
parent
849b4a062c
commit
65eddbcc90
|
@ -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
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue