gerardo2m Posted October 27, 2017 Posted October 27, 2017 Hi. I need to assign the name to a variable, but taking the name of an element from a LIST. Example: Command: (setq TEMPORAL '*Blocks*) *BLOCKS* Command: (set TEMPORAL 250) 250 Command: !TEMPORAL *BLOCKS* Command: !*blocks* 250 Until here Ok. Now it is required that the name of the variable is taken from an element in a LIST: (setq x1 (list "*blocks*" "*layers")) ("*blocks*" "*layers") Command: (set TEMPORAL (nth 0 x1)) "*blocks*" I do not require the value "*blocks*" to be assigned to the TEMPORAL symbol, but symbol *BLOCKS* is assigned. How can this be done? Regards. gerardo2m. Quote
Lee Mac Posted October 27, 2017 Posted October 27, 2017 Either: (setq x1 '(*blocks* *layers*)) (setq TEMPORAL (car x1)) (set TEMPORAL 250) Or: (setq x1 (list '*blocks* '*layers*)) (setq TEMPORAL (car x1)) (set TEMPORAL 250) Or: (setq x1 (list "*blocks*" "*layers*")) (setq TEMPORAL (read (car x1))) (set TEMPORAL 250) Looks like a homework assignment to me. Quote
gerardo2m Posted October 28, 2017 Author Posted October 28, 2017 I aprecciate you support Lee, thanks. It isn't homework, I was stuck with that part of the code to use MAPCAR and LAMBDA for extract info of drawing's Colecctions. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.