diff options
author | IOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at> | 2018-04-30 21:45:07 +0200 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at> | 2018-04-30 21:45:07 +0200 |
commit | be4b008536f3c28b5f025c8618ac3acb1cd065ad (patch) | |
tree | d58751a8750d39e167289b357c96e6da3e5fe67a /stuff.scm | |
parent | 0f71f6cd817b5747663b516d620059680789fbc1 (diff) |
New upstream version 18.3
Diffstat (limited to 'stuff.scm')
-rw-r--r-- | stuff.scm | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |