diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/lux.lux | 20 |
1 files changed, 14 insertions, 6 deletions
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'] |