Skip to content

Instantly share code, notes, and snippets.

@jwhiteman
Created July 30, 2014 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwhiteman/34d447a0d249d2e29035 to your computer and use it in GitHub Desktop.
Save jwhiteman/34d447a0d249d2e29035 to your computer and use it in GitHub Desktop.
2 arg Y
(define y2
(lambda (c)
((lambda (h)
(h h))
(lambda (f)
(c (lambda (x y)
((f f) x y)))))))
(define make-rember
(y2 (lambda (f)
(lambda (a l)
(cond
((null? l) '())
((eq? (car l) a)
(f a (cdr l)))
(else
(cons (car l)
(f a (cdr l)))))))))
(make-rember 'c '(a c d c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment