Skip to content

Commit

Permalink
multirember
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed May 10, 2012
1 parent 2f387b7 commit 9e454ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions little.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@
((or (eq? (car lat) old1) (eq? (car lat) old2))
(cons new (cdr lat)))
(else (cons (car lat) (subst2 new old1 old2 (cdr lat))))))))

; remove all matching members
(define (multirember a lat)
(cond
((null? lat) '())
((eq? (car lat) a) (multirember a (cdr lat)))
(else (cons (car lat) (multirember a (cdr lat))))))

0 comments on commit 9e454ec

Please sign in to comment.