From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sunway Newsgroups: gmane.emacs.help Subject: Re: how to convert a string to a symbol? Date: Sun, 14 Sep 2008 00:10:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: <08e88ade-63f9-416c-8644-caf95ff2a863@z11g2000prl.googlegroups.com> References: <003701c9162e$58cfcd50$0200a8c0@us.oracle.com> 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 1221378070 18875 80.91.229.12 (14 Sep 2008 07:41:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2008 07:41:10 +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 09:42:06 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 1KemFA-0005yQ-9f for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 09:42:04 +0200 Original-Received: from localhost ([127.0.0.1]:59954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KemE9-0004yA-GH for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 03:41:01 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z11g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 123.127.134.57 Original-X-Trace: posting.google.com 1221376233 424 127.0.0.1 (14 Sep 2008 07:10:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 14 Sep 2008 07:10:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z11g2000prl.googlegroups.com; posting-host=123.127.134.57; posting-account=ngAdqwoAAAA0uK1OfC15kE5UvDiCOvxy User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.51 (X11; Linux i686; U; zh-cn),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 localhost.localdomain:8080 (squid/2.6.STABLE18) Original-Xref: news.stanford.edu gnu.emacs.help:162214 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:57557 Archived-At: I don't want to take "(> 2 1)" as a symbol name, instead I want "(> 2 1)" be evaled to 't' On Sep 14, 2:10=A0pm, "Drew Adams" wrote: > > > (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' ab= ove): > > (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)...