[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a list
From: |
Barry Margolin |
Subject: |
Re: Creating a list |
Date: |
Thu, 19 Nov 2009 08:47:09 -0500 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <873a4afyi0.fsf@Traian.DecebalComp>,
Cecil Westerhof <Cecil@decebal.nl> wrote:
> David Kastrup <dak@gnu.org> 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.
I think you mean "of 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 list containing the symbol, so it wasn't
evaluated.
> - current-amount is a local variable. How is it possible that the symbol
> is still defined?
Symbols are permanent, only bindings are local.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Gnus: Some new mails are automatically marked as 'O', Wang Lei, 2009/11/19