From 8a47a5c1a421e3f65297b5e5ecd053e3f65a7beb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 27 Jan 2015 01:17:59 -0400 Subject: [Working on] - Huge refactoring of the lux/compiler ns. - No more difference between compiling global lambda definitions vs regular lambdas. --- source/lux.lux | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source/lux.lux') diff --git a/source/lux.lux b/source/lux.lux index 29d7f3f5c..1a5317991 100644 --- a/source/lux.lux +++ b/source/lux.lux @@ -85,6 +85,14 @@ ))))) #( + (defmacro (lambda tokens) + (case tokens + (#Cons self (#Cons args (#Cons body #Nil))) + + + (#Cons args (#Cons body #Nil)) + )) + (def' id (lambda [x] x)) (def' + (lambda [x y] (jvm:iadd x y))) @@ -224,16 +232,16 @@ (let length (jvm:invokevirtual String "length" [] text []) (map (lambda' idx - (jvm:invokevirtual String "charAt" [int] - text [idx])) + (jvm:invokevirtual String "charAt" [int] + text [idx])) (range 0 length)))) (def (enumerate list) (case (fold (lambda' state - (lambda' x - (case state - [idx list'] - [(inc idx) (#Cons [idx x] list')]))) + (lambda' x + (case state + [idx list'] + [(inc idx) (#Cons [idx x] list')]))) [0 #Nil] list) [_ list'] -- cgit v1.2.3