summaryrefslogtreecommitdiff
path: root/tests/stdlib.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib.lisp')
-rw-r--r--tests/stdlib.lisp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stdlib.lisp b/tests/stdlib.lisp
index fd72dd8..e23364c 100644
--- a/tests/stdlib.lisp
+++ b/tests/stdlib.lisp
@@ -14,6 +14,22 @@
(do (f start) (for (+ start 1) end f))
'()))
+(define take-while (f l)
+ (cond
+ (null? l)
+ l
+ (f (car l))
+ (cons (car l) (take-while f (cdr l)))
+ '()))
+
+(define drop-while (f l)
+ (cond
+ (null? l)
+ l
+ (f (car l))
+ (drop-while f (cdr l))
+ l))
+
(define stdin (sys-stdin))
(define stdout (sys-stdout))
(define stderr (sys-stderr))