From 282762a3b12d24c3b3cec8db7e9a103245926d36 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 12 May 2020 21:48:14 -0700 Subject: Add strip and flatten --- Alpha/Core.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Alpha/Core.scm') 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)))) -- cgit v1.2.3