about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-20 22:57:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-20 23:07:23 -0700
commit77f347c18185534e951b0f9bfa0990cc824ec8e1 (patch)
treee455c2880f00e2ac3547c5ede737d01b1835353f
parentb195921b5ff24e2fd11ba25d48df86b5912b45d7 (diff)
downloadmu-77f347c18185534e951b0f9bfa0990cc824ec8e1.tar.gz
shell: now no definitions with long lines
-rw-r--r--shell/data.limg10
1 files changed, 7 insertions, 3 deletions
diff --git a/shell/data.limg b/shell/data.limg
index e2e4923b..72eba040 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -38,6 +38,10 @@
     (compose . [def (compose f g)
   (fn args
     (f (apply g args)))])
+    (caar . [define caar (compose car car)])
+    (cadr . [define cadr (compose car cdr)])
+    (cddr . [define cddr (compose cdr cdr)])
+    (cdar . [define cdar (compose cdr car)])
     (some . [def (some f xs)
   if (no xs)
     ()
@@ -62,12 +66,12 @@
     ()
     if (no (cdr xs))
       (list (list (car xs)))
-      (cons (list (car xs) (car (cdr xs)))
-            (pair (cdr (cdr xs))))])
+      (cons (list (car xs) (cadr xs))
+            (pair (cddr xs)))])
     (with . [mac (with vars_vals . body)
   `((fn ,(map1 car (pair vars_vals))
       ,@body)
-    ,@(map1 (compose car cdr) (pair vars_vals)))])
+    ,@(map1 cadr (pair vars_vals)))])
     (afn . [mac (afn params . body)
   `(let self ()
      (set self (fn ,params ,@body)))])