[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to remove verbosity from the data passing mechanism using alist
From: |
Fren Zeee |
Subject: |
Re: How to remove verbosity from the data passing mechanism using alist or plist ? |
Date: |
Wed, 8 Dec 2010 18:30:58 -0800 |
>
>> cons expects the second argument to be a list
>
> No it doesn't.
>
> Please refer to An Introduction to Programming in Emacs Lisp, Chapter 7,
> "car, cdr, cons: Fundamental Functions".
>
Thanks a lot !
You can now see that I have read the link and highlighting shows I have understood the point. Now, lets get moving with the rest of the ideas of Thien-Thi .
(cons 'pine '(fir oak maple))
After evaluating this list, you will see
(pine fir oak maple)
appear in the echo area. cons
causes the creation of a new list in which the element is followed by the elements of the original list.
We often say that `cons
puts a new element at the beginning of a list; it attaches or pushes elements onto the list', but this phrasing can be misleading, since cons
does not change an existing list, but creates a new one.
Build a list
cons must have a list to attach to.9 You cannot start from absolutely nothing. If you are building a list, you need to provide at least an empty list at the beginning. Here is a series of cons expressions that build up a list of flowers. If you are reading this in Info in GNU Emacs, you can evaluate each of the expressions in the usual way; the value is printed in this text after ‘⇒’, which you may read as `evaluates to'.
(cons 'buttercup ())
⇒ (buttercup)
(cons 'daisy '(buttercup))
⇒ (daisy buttercup)
The second example, (cons 'daisy '(buttercup))
constructs a new, two element list by putting daisy
in front of buttercup
;
- How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/05
- Message not available
- Message not available
- Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/07
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Stefan Monnier, 2010/12/07
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/07
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Chad Brown, 2010/12/07
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/07
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/07
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Chong Yidong, 2010/12/08
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?,
Fren Zeee <=
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Stefan Monnier, 2010/12/08
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/10
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, PJ Weisberg, 2010/12/10
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, joakim, 2010/12/10
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/10
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/10
- Message not available
- Re: Fwd: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/12
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Miles Bader, 2010/12/12
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/13
- Re: How to remove verbosity from the data passing mechanism using alist or plist ?, Fren Zeee, 2010/12/13