about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-07 21:13:24 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-07 21:13:24 -0700
commit1adc904ef31a77aa7044ce9e828036f539588369 (patch)
treea640534ad8331aeaaf691a63d375177cb5e544aa /shell
parent888b4cd8eabff44ad10954f26bd4df4497e28617 (diff)
downloadmu-1adc904ef31a77aa7044ce9e828036f539588369.tar.gz
new shell macro: do
Diffstat (limited to 'shell')
-rw-r--r--shell/data.limg5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/data.limg b/shell/data.limg
index 7b8654be..8b46e58b 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -2,10 +2,11 @@
   (globals . (
     (mac . [(def mac (litmac litfn () (name params . body)
   `(def ,name (litmac litfn () ,params ,@body))))])
-    (when . [(mac when (cond body)
-  `(if ,cond ,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) ()))])
     (hline1 . [(def hline1 (fn (screen y x xmax color)
   (while (< x xmax)
     (pixel screen x y color)