aboutsummaryrefslogtreecommitdiffstats
path: root/csc/list.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-06-26 20:14:19 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-06-26 20:14:19 -0700
commit52da9c556a170ed8e5f811c3acd56088baf94c80 (patch)
tree938762f3056d9b14b1a2dfba69cff6d30a7ca836 /csc/list.csc
parentMore CPS. (diff)
downloadchromatopelma-52da9c556a170ed8e5f811c3acd56088baf94c80.tar.zst
Finish CPS.
Wow we actually finished CPS. Next is closure conversion, then codegen, and then we should be able to run some end to end tests. Then we can look at garbage collection, and from there continue building features down the long road to self hosting.
Diffstat (limited to 'csc/list.csc')
-rw-r--r--csc/list.csc10
1 files changed, 9 insertions, 1 deletions
diff --git a/csc/list.csc b/csc/list.csc
index 95fff04..cc64168 100644
--- a/csc/list.csc
+++ b/csc/list.csc
@@ -1,5 +1,6 @@
(define-library (csc list)
(export
+ all
enumerate
filter
intercalate
@@ -70,4 +71,11 @@
(loop for x in l
collect (car x) into xs
collect (cdr x) into ys
- finally (return (values xs ys))))))
+ finally (return (values xs ys))))
+
+
+ (define (all pred l)
+ (loop for x in l
+ unless (pred x)
+ return #f
+ finally (return #t)))))