currying using emacs lisp

116 views
Skip to first unread message

Brian E. Lavender

unread,
Sep 17, 2014, 2:40:13 AM9/17/14
to eo...@googlegroups.com
I am just trying the simple currying example from the Little Schemer
(hopefully not too unrelated) in emacs lisp and I don't seem to be having
any luck.

(defun eq?-c (a)
(function
(lambda (x)
(eq x a))) )

(setq eq?-salad (eq?-c 'salad)) ;; doesn't seem to get applied to a

(setq y 'salad)

(funcall eq?-salad y)

I get the error:
Symbol's value as variable is void: a

Does currying work in elisp?

brian
--
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture
signature.asc

Brian E. Lavender

unread,
Sep 18, 2014, 11:24:44 PM9/18/14
to eo...@googlegroups.com
I switched to guile and it works. I think this will work with elisp now,
but I will leave that for another day.
signature.asc
Reply all
Reply to author
Forward
0 new messages