From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: Weird error message "wrong-type-argument symbolp (quote foo)" Date: Wed, 10 Jun 2009 12:12:57 GMT Organization: Sonera Customer Message-ID: <87k53kxp6i.fsf@iki.fi> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1244637707 29523 80.91.229.12 (10 Jun 2009 12:41:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jun 2009 12:41:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 10 14:41:45 2009 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 1MEN7f-0000vT-PS for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jun 2009 14:41:44 +0200 Original-Received: from localhost ([127.0.0.1]:52211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEN7f-0005Fa-7z for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jun 2009 08:41:43 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!uio.no!newsfeed1.funet.fi!newsfeeds.funet.fi!feeder1.news.saunalahti.fi!nntp.inet.fi!central1.inet.fi!inet.fi!read4.inet.fi.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) Cancel-Lock: sha1:U8UR6gYgk3bcaYYzyJSKCp7uEOI= Original-Lines: 51 Original-NNTP-Posting-Host: 84.251.6.80 Original-X-Complaints-To: abuse@inet.fi Original-X-Trace: read4.inet.fi 1244635977 84.251.6.80 (Wed, 10 Jun 2009 15:12:57 EEST) Original-NNTP-Posting-Date: Wed, 10 Jun 2009 15:12:57 EEST Original-Xref: news.stanford.edu gnu.emacs.help:169886 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:65116 Archived-At: On 2009-06-10 04:45 (-0700), florian wrote: > Dear wizards, I'm not one but... > I would not have thought that such an error message was possible, > since (quote foo) should be the same as 'foo, hence, a symbol. I have > managed to produce it like this: Unevaluated "(quote foo)" is not a symbol, it's a list. "foo" is a symbol. > (let ((foo 1) > (bar 2) > (fubar 3)) > (dolist (var '('foo 'bar 'fubar)) Here you have double quoting. You quote the list from being evaluated "'( ... )" and you have also all the three list items quoted. Effectively all the list items are lists themselves, that is: "(quote foo) (quote bar) (quote fubar)". > (message "%S's value is %d" > var (symbol-value var)))) So the value of "var" is a list like "(quote foo)" which is not evaluated anymore. To fix the problem either drop the double-quoting (see above) or evaluate "var" once more, like "(eval var)". > The following form, which should produce the same error, however, does > not complain (just as I expected): > > (let ((var (quote foo))) > (symbol-value var)) > (let ((var 'foo)) > (symbol-value var)) These work because there is no double quoting. The value of "var" is just symbol "foo", not a list "(quote foo)" like in your previous example. > Also, symbolp and symbol-value do not complain if they get sth like > "(quote foo)" as argument. Can anybody point me to what on earth is > going on in the first form? Thanks so much! Actually only in your first, broken example "symbolp" and "symbol-value" get a list like "(quote foo)" as argument and thus they complain. In your latter examples they get symbol "foo" as argument. The reason is the double quoting.