Currying in Lisp
(defun curry-binary-fn (f firstarg)
#’(lambda (x) (funcall f firstarg x)) )
(setq cons-with-john
(curry-binary-fn #’cons ’john) )
(funcall cons-with-john 21)
=> (21 . JOHN)
Previous slide
Next slide
Back to first slide
View graphic version