summaryrefslogtreecommitdiff
path: root/Alpha/Core.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-05-12 21:48:14 -0700
committerBen Sima <ben@bsima.me>2020-05-12 21:48:14 -0700
commit282762a3b12d24c3b3cec8db7e9a103245926d36 (patch)
treec4279e928265e07113b25ebc23ed1ffe50cb1012 /Alpha/Core.scm
parent1ff73c7c6b1c0e30c6076663f6b771f9b5bd9009 (diff)
Add strip and flatten
Diffstat (limited to 'Alpha/Core.scm')
-rw-r--r--Alpha/Core.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alpha/Core.scm b/Alpha/Core.scm
index 0ef1098..4ce0bbb 100644
--- a/Alpha/Core.scm
+++ b/Alpha/Core.scm
@@ -213,3 +213,9 @@
(if (list? x)
x
(list x)))
+
+;; is this not in srfi-1?
+(define (flatten x)
+ (cond ((null? x) '())
+ ((pair? x) (append (flatten (car x)) (flatten (cdr x))))
+ (else (list x))))