diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-20 22:57:36 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-20 23:07:23 -0700 |
commit | 77f347c18185534e951b0f9bfa0990cc824ec8e1 (patch) | |
tree | e455c2880f00e2ac3547c5ede737d01b1835353f /shell | |
parent | b195921b5ff24e2fd11ba25d48df86b5912b45d7 (diff) | |
download | mu-77f347c18185534e951b0f9bfa0990cc824ec8e1.tar.gz |
shell: now no definitions with long lines
Diffstat (limited to 'shell')
-rw-r--r-- | shell/data.limg | 10 |
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)))]) |