diff options
author | Ben Sima <ben@bsima.me> | 2019-11-02 18:45:31 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-11-02 18:45:31 -0700 |
commit | d81c3a147543e0440c9efa547dc1a7904ea30a8c (patch) | |
tree | 6f0129ce3508d72df741601dc7e14e9d8228d497 /Com | |
parent | caecb53ded78d137e594c36e7c9e0d9814ce3349 (diff) |
add some clojure-inspired scheme functions
Diffstat (limited to 'Com')
-rw-r--r-- | Com/Simatime/core.scm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Com/Simatime/core.scm b/Com/Simatime/core.scm index dbacd8a..4d523ea 100644 --- a/Com/Simatime/core.scm +++ b/Com/Simatime/core.scm @@ -79,6 +79,15 @@ (define (nil? x) (eq? nil x)) +(define (some pred coll) + (or (pred (first coll)) + (some pred (next coll)))) + +(define comp compose) + +(define (not-any? pred coll) + (comp not some)) + (define-syntax when-not (syntax-case (()))) |