In this code dolist binds x to symbols ‘foo and ‘bar.
(dolist (x '(foo bar))
(print (symbolp x) t))
This is a problem if I want to use values of foo and bar, like:
(dolist (x '(foo bar))
(print x t))
How to get around it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
xis bound to the symbolsfooandbarbecause'(foo bar)is a list containing the symbolsfooandbar. If you want a list that contains the values of the variablesfooandbar, you can use(list foo bar).