Q&A's, tips, howto's
jopython
Posts: 123 Joined: Tue Sep 14, 2010 3:08 pm
Post
by jopython » Mon May 20, 2013 1:09 pm
I have a list of symbols in a list named 'mems'
How do i extract the "values" of those symbols instead of the symbols themselves?
Code: Select all
: mems
(s1 s2 s3 s4 s5)
: s1
("hi")
: (map symbol? mems)
(true true true true true)
jopython
Posts: 123 Joined: Tue Sep 14, 2010 3:08 pm
Post
by jopython » Mon May 20, 2013 1:15 pm
never mind:
I figured it is
(map eval mems)
rickyboy
Posts: 607 Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia
Post
by rickyboy » Mon May 20, 2013 2:58 pm
That's great. I sometimes have to ask someone about a problem I'm stuck on, and then in the asking, I figure out myself what the problem is. I think that often the only thing we need is a sounding board. Excellent.
BTW, this too might work: (eval (cons 'list mems))
(λx. x x) (λx. x x)
Lutz
Posts: 5289 Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:
Post
by Lutz » Mon May 20, 2013 3:15 pm
and this too: (eval (cons list mems)) w/o the quote ;)
jopython
Posts: 123 Joined: Tue Sep 14, 2010 3:08 pm
Post
by jopython » Mon May 20, 2013 8:54 pm
Thank you for the quick responses. Love you people.