From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Creating a list Date: Thu, 19 Nov 2009 14:57:17 +0100 Organization: Organization?!? Message-ID: <87y6m2ipmq.fsf@lola.goethe.zz> References: <87k4xnge1t.fsf@Traian.DecebalComp> <87y6m2kj3m.fsf@lola.goethe.zz> <874ooqhjaw.fsf@Traian.DecebalComp> <874ooqkah6.fsf@lola.goethe.zz> <873a4afyi0.fsf@Traian.DecebalComp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258642757 9142 80.91.229.12 (19 Nov 2009 14:59:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 14:59:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 15:58:51 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 1NB8TA-0002ZB-P0 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 15:58:49 +0100 Original-Received: from localhost ([127.0.0.1]:42380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NB8TA-0006PU-C6 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 09:58:48 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeder.news-service.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!195.14.215.230.MISMATCH!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:CPdXOj33PGOXVjoyfBI0c1ymFUk= Original-Lines: 40 Original-NNTP-Posting-Date: 19 Nov 2009 14:57:18 CET Original-NNTP-Posting-Host: caf14b4c.newsspool2.arcor-online.net Original-X-Trace: DXC=[dCD2EHQVf][7Non7UCi8UA9EHlD; 3YcR4Fo<]lROoRQ8kF5MOK` 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:69924 Cecil Westerhof writes: > David Kastrup writes: > >>>>> At the moment I create a list with: >>>>> (setq ret-val (cons total-amount (cons current-amount ()))) >>>>> I thought about doing it with: >>>>> (setq ret-val (cons total-amount '(current-amount))) >>>>> >>>>> But then the second value is the string current-amount >>>> >>>> Wrong. The _symbol_ current-amount. >>> >>> When evaluating I got: >>> (1570378.2570192777 current-amount) >>> That is why I thought I got the string. >> >> A string would have quote marks around it. > > Off course. > > But I have a few questions on my mind. > - Why is the first shown as value and the second as _symbol_? Because you quoted the entire list containing the second value. > - current-amount is a local variable. How is it possible that the symbol > is still defined? I really recommend that you read a Lisp introduction. Your questions are very very basic. A symbol, like a plain unquoted list, _is_ a valid expression all by itself. In the context of evaluation, a further interpretation tries going from there (fetching a symbol's value, calling the first element of a list as a function on the rest). But whether or not you can usefully call eval on it, either are printable and useful expressions. -- David Kastrup