[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert strings to symbol
From: |
Andreas Röhler |
Subject: |
Re: convert strings to symbol |
Date: |
Mon, 16 Jun 2008 18:48:31 +0200 |
User-agent: |
KMail/1.9.6 (enterprise 20070904.708012) |
Am Montag, 16. Juni 2008 schrieb David Kastrup:
> Andreas Röhler <andreas.roehler@online.de> writes:
>
> > Am Montag, 16. Juni 2008 schrieb alruccaba@justmail.de:
> >> Does someone have an idea how to convert a string object to a symbol?
> >> One purpose would be some kind of variable substitution :
> >>
> >> (setq y "z")
> >> (setq x "y")
> >> (print ..? x ....) -> "z"
> >>
> >> Thanks in advance.
> >
> > make-symbol (?)
> >
> > (setq a (make-symbol "eins"))
> > a => eins
>
> No, that is entirely useless since it creates a new symbol that has only
> the print name "eins" but is not accessible via its name.
>
> He wants something like
>
> (print (symbol-value (intern x)))
>
> --
> David Kastrup, Kriemhildstr. 15, 44793 Bochum
>
Don't work for me.
Even not with
(print (symbol-value (intern "x")))
So it works:
(setq a (intern "x"))
(print (symbol-value 'a))
Probably you can explain the reasons.
Andreas Röhler