diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-04-25 23:53:12 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-04-25 23:53:12 -0400 |
commit | 5bf77cc39f3ce9d9be06ebcc12f6d587c4ae1847 (patch) | |
tree | 1be124e060dac758bbe3b82fd91a52fed321804c | |
parent | 4ffc5299c015a0c8e0237ab8c0f710b586640fd4 (diff) | |
download | spectrum-5bf77cc39f3ce9d9be06ebcc12f6d587c4ae1847.tar.gz spectrum-5bf77cc39f3ce9d9be06ebcc12f6d587c4ae1847.zip |
update (and line) prelude.scm
-rw-r--r-- | prelude.scm | 10 | ||||
l--------- | rust/prelude.scm | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/prelude.scm b/prelude.scm index 1a8d853..a3b123e 100644 --- a/prelude.scm +++ b/prelude.scm @@ -15,10 +15,18 @@ (define cddar (lambda (x) (car (cdr (cdr x))))) (define cdddr (lambda (x) (car (cdr (cdr x))))) +; my favorite! +(define cdaddr (lambda (x) (cdr (car (cdr (cdr x)))))) + (define if (lambda (pred tval fval) (cond (pred tval) (else fval)))) (define not (lambda (x) (if x #f #t))) (define abs (lambda (x) (if (> x 0) x (* -1 x)))) -;(define for-each map) +(define map + (lambda (f l) + (cond ((null? l) ()) + (else (cons (f (car l)) (map f (cdr l))))))) + +(define for-each map) ;(define compose (lambda (f g) (lambda args (f (apply g args))))) diff --git a/rust/prelude.scm b/rust/prelude.scm new file mode 120000 index 0000000..84e0834 --- /dev/null +++ b/rust/prelude.scm @@ -0,0 +1 @@ +../prelude.scm
\ No newline at end of file |