summaryrefslogtreecommitdiff
path: root/stuff.scm
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>2018-04-30 21:45:07 +0200
committerIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>2018-04-30 21:45:07 +0200
commitbe4b008536f3c28b5f025c8618ac3acb1cd065ad (patch)
treed58751a8750d39e167289b357c96e6da3e5fe67a /stuff.scm
parent0f71f6cd817b5747663b516d620059680789fbc1 (diff)
New upstream version 18.3
Diffstat (limited to 'stuff.scm')
-rw-r--r--stuff.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/stuff.scm b/stuff.scm
index 32b1982..9d634ce 100644
--- a/stuff.scm
+++ b/stuff.scm
@@ -528,6 +528,8 @@ If func approves of one, index-if returns the index that gives that element's po
(let ((+documentation+ "(collect-if type func sequence) gathers the elements of sequence that satisfy func, and returns them via type:\n\
(collect-if list integer? #(1.4 2/3 1 1+i 2)) -> '(1 2)"))
(lambda (type f sequence)
+ (unless (sequence? sequence)
+ (error 'wrong-type-arg "collect-if: sequence arg is ~A" sequence))
(apply type (map (lambda (arg) (if (f arg) arg (values))) sequence)))))
;;; if type=list, this is slightly wasteful because list currently copies its args, so:
@@ -539,6 +541,8 @@ If func approves of one, index-if returns the index that gives that element's po
(let ((+documentation+ "(remove-if type f sequence) returns via type the elements of sequence that do not satisfy func:\n\
(remove-if list integer? #(1.4 2/3 1 1+i 2)) -> '(1.4 2/3 1+1i)"))
(lambda (type f sequence)
+ (unless (sequence? sequence)
+ (error 'wrong-type-arg "remove-if: sequence arg is ~A" sequence))
(collect-if type (lambda (obj) (not (f obj))) sequence))))
(define nonce