(define replace-first
(lambda (obj-a obj-b lst)
(if (member obj-a lst)
(let loop ((new '())
(lstb lst))
(if (equal? (car lstb) obj-a)
(append new (list obj-b) (cdr lstb))
(loop (append new (list (car lstb))) (cdr lstb))))
lst)))