From 52da9c556a170ed8e5f811c3acd56088baf94c80 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 26 Jun 2022 20:14:19 -0700 Subject: 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. --- csc/list.csc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'csc/list.csc') 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))))) -- cgit v1.3.1