Skip to content

Instantly share code, notes, and snippets.

@mori-dev
Created March 30, 2010 15:32
Show Gist options
  • Save mori-dev/349206 to your computer and use it in GitHub Desktop.
Save mori-dev/349206 to your computer and use it in GitHub Desktop.
(remove-if 'oddp '(1 2 3 4 5 6))
;;=>(2 4 6)
(defun complement (fn)
(lexical-let ((fn fn))
(lambda (&rest args) (not (apply fn args)))))
(remove-if (complement 'oddp) '(1 2 3 4 5 6))
;;=>(1 3 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment