(let ((lose (lambda () (error:not-a list? items caller))))
(let loop ((items items))
(if (pair? items)
- (if (= (car items) item)
+ (if (or (eq? (car items) item)
+ (= (car items) item))
items
(loop (cdr items)))
(begin
(let ((head (cons (car items) '())))
(let loop ((items (cdr items)) (previous head))
(cond ((pair? items)
- (if (= (car items) item)
+ (if (or (eq? (car items) item)
+ (= (car items) item))
(loop (cdr items) previous)
(let ((new (cons (car items) '())))
(set-cdr! previous new)
(loop (cdr items) new))))
((not (null? items))
(lose))))
- (if (= (car items) item)
+ (if (or (eq? (car items) item)
+ (= (car items) item))
(cdr head)
head))
(begin
((trim-initial-segment
(lambda (items)
(if (pair? items)
- (if (= item (car items))
+ (if (or (eq? item (car items))
+ (= item (car items)))
(trim-initial-segment (cdr items))
(begin
(locate-initial-segment items (cdr items))
(locate-initial-segment
(lambda (last this)
(if (pair? this)
- (if (= item (car this))
+ (if (or (eq? item (car this))
+ (= item (car this)))
(set-cdr! last
(trim-initial-segment (cdr this)))
(locate-initial-segment this (cdr this)))
(begin
(if (not (pair? (car alist)))
(lose))
- (if (= (car (car alist)) key)
+ (if (or (eq? (car (car alist)) key)
+ (= (car (car alist)) key))
(car alist)
(loop (cdr alist))))
(begin
(cond ((pair? alist)
(if (not (pair? (car alist)))
(lose))
- (if (= (car (car alist)) key)
+ (if (or (eq? (car (car alist)) key)
+ (= (car (car alist)) key))
(loop (cdr alist) previous)
(let ((new (cons (car alist) '())))
(set-cdr! previous new)
(loop (cdr alist) new))))
((not (null? alist))
(lose))))
- (if (= (car (car alist)) key)
+ (if (or (eq? (car (car alist)) key)
+ (= (car (car alist)) key))
(cdr head)
head)))
(begin
(begin
(if (not (pair? (car items)))
(lose))
- (if (= (car (car items)) item)
+ (if (or (eq? (car (car items)) item)
+ (= (car (car items)) item))
(trim-initial-segment (cdr items))
(begin
(locate-initial-segment items (cdr items))
(cond ((pair? this)
(if (not (pair? (car this)))
(lose))
- (if (= (car (car this)) item)
+ (if (or (eq? (car (car this)) item)
+ (= (car (car this)) item))
(set-cdr!
last
(trim-initial-segment (cdr this)))