Skip to content

Instantly share code, notes, and snippets.

@davidreynolds
Created August 15, 2010 17:11
Show Gist options
  • Save davidreynolds/525702 to your computer and use it in GitHub Desktop.
Save davidreynolds/525702 to your computer and use it in GitHub Desktop.
;; Is this a good way to "remove" elements from a list? It just builds a new
;; list after filtering out the element I want removed.
(define (filter-out-fd fd)
;; builds a new list after filtering out fd
(let loop ((li fd-list) (newlist '()))
(if (null? li)
newlist
(if (eq? fd (car li))
(loop (cdr li) newlist)
(loop (cdr li) (append newlist (list (car li))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment