SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[remove] | [Index] | [remq]>> |
Conformance: R5.91RS Scheme
Purpose: Remove members from lists. Create a new list containing the members of a given list that do not match a given predicate.
Arguments:
P - predicate
A - list
Model:
(define (remp p a) (cond ((null? a) '()) ((p (car a)) (cdr a)) (else (cons (car a) (remp x (cdr a))))))
Implementation:
(define (remp p a) (filter (lambda (x) (not (p x))) a))
Example:
(remp symbol? '(a b c (x . y) d e f)) => ((x . y))
See also:
remove,
remq,
remv,
memp,
assp.
<<[remove] | [Index] | [remq]>> |