From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: convert strings to symbol Date: Fri, 20 Jun 2008 16:25:47 +0200 Message-ID: <200806201625.49787.andreas.roehler@online.de> References: <85zlplcnik.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1213971877 2025 80.91.229.12 (20 Jun 2008 14:24:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2008 14:24:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 16:25:18 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K9hYC-0002E0-TO for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Jun 2008 16:25:17 +0200 Original-Received: from localhost ([127.0.0.1]:48329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9hXN-0003Qt-Qw for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Jun 2008 10:24:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K9hX2-0003Qc-Dm for help-gnu-emacs@gnu.org; Fri, 20 Jun 2008 10:24:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K9hWx-0003JL-GE for help-gnu-emacs@gnu.org; Fri, 20 Jun 2008 10:24:02 -0400 Original-Received: from [199.232.76.173] (port=56315 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9hWx-0003J2-CT for help-gnu-emacs@gnu.org; Fri, 20 Jun 2008 10:23:59 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.188]:60322) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K9hWv-0000la-RL for help-gnu-emacs@gnu.org; Fri, 20 Jun 2008 10:23:58 -0400 Original-Received: from noname (p54BE8943.dip0.t-ipconnect.de [84.190.137.67]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1K9hWk1hnx-0000gi; Fri, 20 Jun 2008 16:23:46 +0200 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) In-Reply-To: <85zlplcnik.fsf@lola.goethe.zz> Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX18eac+uMm4MzSkpRha308uViUOkJdAdhEYB1nJ 8TDroU+7fSyDxoylwlD3PS/xI+lnOOdUwlFRVnm5t/Ri6sjzh0 qey1AN3MnvoZEEJM8gv1g== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54986 Archived-At: Am Montag, 16. Juni 2008 schrieb David Kastrup: > Andreas R=F6hler writes: >=20 > > Am Montag, 16. Juni 2008 schrieb David Kastrup: > >> Andreas R=F6hler writes: > >>=20 > >> > Am Montag, 16. Juni 2008 schrieb alruccaba@justmail.de: > >> >> Does someone have an idea how to convert a string object to a symbo= l? > >> >> One purpose would be some kind of variable substitution : > >> >>=20 > >> >> (setq y "z") > >> >> (setq x "y") > >> >> (print ..? x ....) -> "z" > >> >>=20 > >> >> Thanks in advance. > >> > > >> > make-symbol (?) > >> > > >> > (setq a (make-symbol "eins")) > >> > a =3D> eins > >>=20 > >> No, that is entirely useless since it creates a new symbol that has on= ly > >> the print name "eins" but is not accessible via its name. > >>=20 > >> He wants something like > >>=20 > >> > > > > Don't work for me. >=20 > Works perfectly for me. >=20 > (setq y "z") > (setq x "y") > (print (symbol-value (intern x))) -> "z" >=20 > > Even not with > > > > (print (symbol-value (intern "x"))) >=20 > That yields "y". Obviously. >=20 > > So it works: > > > > (setq a (intern "x")) > > > > (print (symbol-value 'a)) > > > > Probably you can explain the reasons. >=20 > Looks like you should reread what you were replying to.=20 Seems so. Thanks Andreas R=F6hler > What I posted=20 > works _exactly_ like the poster wanted it to work. You are doing > something completely different. Which also works in that it does > something. Just not what was required. >=20 > --=20 > David Kastrup, Kriemhildstr. 15, 44793 Bochum >=20