remove-first   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

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


Back to Index