diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 9365e0cda..3e373be35 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -2909,18 +2909,15 @@ #None)) (#Some g!name head tail body) (let [g!blank (local-identifier$ "") - g!name (local-identifier$ g!name) - body+ (list@fold (: (-> Code Code Code) - (function' [arg body'] - (if (identifier? arg) - (` ([(~ g!blank) (~ arg)] (~ body'))) - (` ([(~ g!blank) (~ g!blank)] - (case (~ g!blank) (~ arg) (~ body'))))))) - body - (list@reverse tail))] - (return (list (if (identifier? head) - (` ([(~ g!name) (~ head)] (~ body+))) - (` ([(~ g!name) (~ g!blank)] (case (~ g!blank) (~ head) (~ body+)))))))) + nest (: (-> Code (-> Code Code Code)) + (function' [g!name] + (function' [arg body'] + (if (identifier? arg) + (` ([(~ g!name) (~ arg)] (~ body'))) + (` ([(~ g!name) (~ g!blank)] + (.case (~ g!blank) (~ arg) (~ body'))))))))] + (return (list (nest (..local-identifier$ g!name) head + (list@fold (nest g!blank) body (list@reverse tail)))))) #None (fail "Wrong syntax for function"))) |