Setup functions by setq
Posted: Fri Aug 28, 2020 5:54 am
I'd like to make a series of functions whose names come from a list, as shown by the following codes:
what I want is to get two functions
a1: (lambda (y) 0)
a2: (lambda (y) 1)
But I fail.
What's wrong with my code, and how to solve it?
Code: Select all
(setq a '(a1 a2))
(dolist (x a)
(let (z $idx)
(setq x (lambda(y) z))
))
a1: (lambda (y) 0)
a2: (lambda (y) 1)
But I fail.
What's wrong with my code, and how to solve it?