diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/lux.lux | 84 |
1 files changed, 63 insertions, 21 deletions
diff --git a/source/lux.lux b/source/lux.lux index 8c1cb5695..03c2a6054 100644 --- a/source/lux.lux +++ b/source/lux.lux @@ -5,33 +5,33 @@ (jvm;class Tuple0 java.lang.Object []) (jvm;class Tuple1 java.lang.Object - [[java.lang.Object _1]]) + [[java.lang.Object _0]]) (jvm;class Tuple2 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2]]) + [[java.lang.Object _0] [java.lang.Object _1]]) (jvm;class Tuple3 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2]]) (jvm;class Tuple4 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3] [java.lang.Object _4]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2] [java.lang.Object _3]]) (jvm;class Tuple5 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3] [java.lang.Object _4] - [java.lang.Object _5]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2] [java.lang.Object _3] + [java.lang.Object _4]]) (jvm;class Tuple6 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3] [java.lang.Object _4] - [java.lang.Object _5] [java.lang.Object _6]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2] [java.lang.Object _3] + [java.lang.Object _4] [java.lang.Object _5]]) (jvm;class Tuple7 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3] [java.lang.Object _4] - [java.lang.Object _5] [java.lang.Object _6] - [java.lang.Object _7]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2] [java.lang.Object _3] + [java.lang.Object _4] [java.lang.Object _5] + [java.lang.Object _6]]) (jvm;class Tuple8 java.lang.Object - [[java.lang.Object _1] [java.lang.Object _2] - [java.lang.Object _3] [java.lang.Object _4] - [java.lang.Object _5] [java.lang.Object _6] - [java.lang.Object _7] [java.lang.Object _8]]) + [[java.lang.Object _0] [java.lang.Object _1] + [java.lang.Object _2] [java.lang.Object _3] + [java.lang.Object _4] [java.lang.Object _5] + [java.lang.Object _6] [java.lang.Object _7]]) (jvm;class Variant java.lang.Object [[java.lang.String tag] [java.lang.Object value]]) @@ -46,6 +46,49 @@ #Nil]) state]) ))) +(declare-macro let') + +(def' lambda + (lambda' _ tokens + (lambda' _ state + (let' output (case' tokens + (#Cons [(#Form (#Cons [self (#Cons [arg args'])])) (#Cons [body #Nil])]) + (#Form (#Cons [(#Ident "lambda'") + (#Cons [self + (#Cons [arg + (#Cons [(case' args' + #Nil + body + + _ + (#Form (#Cons [(#Ident "lux;lambda") + (#Cons [(#Form (#Cons [(#Ident "_") args'])) + (#Cons [body #Nil])])]))) + #Nil])])])]))) + [(#Cons [output #Nil]) state]) + ))) +(declare-macro lambda) + +## (def' lambda +## (lambda' _ tokens +## (lambda' _ state +## (let' output (case' tokens +## (#Cons [(#Form (#Cons [self (#Cons [arg args'])])) (#Cons [body #Nil])]) +## (#Form (#Cons [(#Ident "lambda'") +## (#Cons [self +## (#Cons [arg +## (#Cons [(case' args' +## #Nil +## body + +## _ +## (#Form (#Cons [(#Ident "lux;lambda") +## (#Cons [(#Form (#Cons [(#Ident "_") args'])) +## (#Cons [body #Nil])])]))) +## #Nil])])])]))) +## [(#Cons [output #Nil]) state]) +## ))) + ## (def' lambda ## (lambda' _ tokens @@ -66,7 +109,6 @@ ## #Nil])])])]))) ## [(#Cons output #Nil) state]) ## ))) -## (declare-macro lambda) ## (def' def ## (lambda (_ tokens state) |