Created
August 15, 2010 17:11
-
-
Save davidreynolds/525702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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