From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard G Riley Newsgroups: gmane.emacs.help Subject: Re: how to convert a string to a symbol? Date: Sun, 14 Sep 2008 12:19:22 +0200 Organization: A noiseless patient Spider Message-ID: References: <003701c9162e$58cfcd50$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221389605 13044 80.91.229.12 (14 Sep 2008 10:53:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2008 10:53:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 14 12:54:21 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 1KepFE-0003nS-JI for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 12:54:20 +0200 Original-Received: from localhost ([127.0.0.1]:38595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KepED-00022f-SF for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 06:53:17 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-X-Trace: feeder.motzarella.org U2FsdGVkX19adQRrM/nYjNNyIMv5/ZGOne+iQQTt+vp65CEbjq8sRy0FSPf8sBDb3U1F3Y7/+5EjbcZndQIJw7Fiqd69lHeP3r+lRdnmuJjZSWkPhYtdjDB5d7w8/aXEoh/s0AXtmM+PDR00ATyQ0g== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sun, 14 Sep 2008 10:20:26 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+W9rhGPdC1r6iofAJkAqwQkzEwN8O9yngTjxQmZtVL8w== Cancel-Lock: sha1:46SEWwC3UNO7806QrZnOlrPnmnA= User-Agent: Emacs 22.2.1/No Gnus v0.11 Original-Xref: news.stanford.edu gnu.emacs.help:162223 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:57566 Archived-At: "Drew Adams" writes: >> > (setq str "(> 2 1)") >> > I want something like: (eval (string-to-symbol str)) >> >> (intern str) > > And if you really want the value of the symbol (per your use of `eval' above): > > (symbol-value (intern str)) > > But you might want to give it a value first ;-) - > > (set (intern "(> 2 1)") 42) > > (symbol-value '\(>\ 2\ 1\)) ; The answer is 42. > > However, as always with questions of this type, one wonders what you are > _really_ trying to do (not to mention why)... It seems from the mention of eval quite clear (not being an elisp programmer myself). He wants the result of the expression held in the string str. e.g (setq str "(> 2 1)") When str is "Eval"ed however you guys tell him to do it then this expression will yield the value of the expression (> 2 1) which is, in this case, 't.