newLISP Fan Club

Forum => newLISP in the real world => Topic started by: jopython on May 20, 2013, 06:09:44 AM

Title: How to extract values from symbols in a list?
Post by: jopython on May 20, 2013, 06:09:44 AM
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?





: mems
(s1 s2 s3 s4 s5)

: s1
("hi")

: (map symbol? mems)
(true true true true true)

Title: Re: How to extract values from symbols in a list?
Post by: jopython on May 20, 2013, 06:15:44 AM
never mind:



I figured it is

(map eval mems)
Title: Re: How to extract values from symbols in a list?
Post by: rickyboy on May 20, 2013, 07:58:49 AM
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))
Title: Re: How to extract values from symbols in a list?
Post by: Lutz on May 20, 2013, 08:15:40 AM
and this too: (eval (cons list mems)) w/o the quote ;)
Title: Re: How to extract values from symbols in a list?
Post by: jopython on May 20, 2013, 01:54:33 PM
Thank you for the quick responses. Love you people.