diff options
author | Eduardo Julian | 2015-01-27 01:17:59 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-01-27 01:17:59 -0400 |
commit | 8a47a5c1a421e3f65297b5e5ecd053e3f65a7beb (patch) | |
tree | d24f81cdc019cf830eec4921ab93984ed1bd2035 /source/lux.lux | |
parent | d6df22d4e8eb8ba5399277bc171aa758cf9c4ed6 (diff) |
[Working on]
- Huge refactoring of the lux/compiler ns.
- No more difference between compiling global lambda definitions vs regular lambdas.
Diffstat (limited to '')
-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'] |