diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-06 16:39:07 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-06 16:39:07 -0700 |
commit | 86f97442575ec383bbed314df662c897b3b11688 (patch) | |
tree | b9f5383f8b61df30c543f31c1a91eb207c5f6526 | |
parent | 4c07de4d3bd28083e83642fe5b98262bedbaa2ea (diff) | |
download | mu-86f97442575ec383bbed314df662c897b3b11688.tar.gz |
.
-rw-r--r-- | shell/data.limg | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/data.limg b/shell/data.limg index c85dd050..7ef4b055 100644 --- a/shell/data.limg +++ b/shell/data.limg @@ -5,6 +5,10 @@ (def . [(mac (def (name . params) . body) `(define ,name (fn ,params ,@body)))]) (do . [(mac (do . body) `((fn () ,@body)))]) + (let . [(mac (let var val . body) + `((fn (,var) ,@body) ,val))]) + (when . [(mac (when cond . body) + `(if ,cond (do ,@body) ()))]) (list . [(def (list . args) args)]) (len . [(def (len l) (if (no l) @@ -15,10 +19,6 @@ () (cons (f (car xs)) (map1 f (cdr xs)))))]) - (let . [(mac (let var val . body) - `((fn (,var) ,@body) ,val))]) - (when . [(mac (when cond . body) - `(if ,cond (do ,@body) ()))]) (++ . [(mac (++ var) `(set ,var (+ ,var 1)))]) (+= . [(mac (+= var inc) `(set ,var (+ ,var ,inc)))]) |