From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fren Zeee Newsgroups: gmane.emacs.devel Subject: Re: How to remove verbosity from the data passing mechanism using alist or plist ? Date: Wed, 8 Dec 2010 18:30:58 -0800 Message-ID: References: <87lj43at0i.fsf@ambire.localdomain> <87fwu8rzgw.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000325575c5a31a47c0496f10744 X-Trace: dough.gmane.org 1291907480 14688 80.91.229.12 (9 Dec 2010 15:11:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 15:11:20 +0000 (UTC) Cc: Chad Brown , "Emacs Dev \[emacs-devel\]" To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 09 16:11:15 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQi9J-0006S3-IH for ged-emacs-devel@m.gmane.org; Thu, 09 Dec 2010 16:11:14 +0100 Original-Received: from localhost ([127.0.0.1]:34377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQi9I-000581-PN for ged-emacs-devel@m.gmane.org; Thu, 09 Dec 2010 10:11:12 -0500 Original-Received: from [140.186.70.92] (port=38084 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQWHe-00038m-E8 for emacs-devel@gnu.org; Wed, 08 Dec 2010 21:31:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQWHb-0000oK-Re for emacs-devel@gnu.org; Wed, 08 Dec 2010 21:31:02 -0500 Original-Received: from mail-iw0-f178.google.com ([209.85.214.178]:38760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQWHb-0000o3-Kt for emacs-devel@gnu.org; Wed, 08 Dec 2010 21:30:59 -0500 Original-Received: by iwn1 with SMTP id 1so2817195iwn.9 for ; Wed, 08 Dec 2010 18:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=cOmLKnnn7nUQOZwuECCKnLlkPnVhKKPB0MmXzxYzjf8=; b=HA3iMcQ2LDDjxiVsvPIX6wjmei2uX+/GxsIXi3VoOy727o/p0qDRFa83mLSqVq7x+1 hF05O8U6OpRH8qzd5UagG3OVv2t4N33UQRkvyhSytWece4uJ8o6Q7Trcz2yvsNxGuw+J NMX3z6Css7Fvzixt9BfOlN8u5AYYapMUGPXmU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=mH2lKQvWKw3+JG+wPRxFKWY4wV4k0a4QWf2lyyP3dq588+ig4qsTIuWTEZcWbrPqsc v5r8xLcDCdwa0FRMrJyy8vvypSidSy1SfbNR/u0A++tGhu+qZcxpkmbPrTq3/Z50vnrw 1Mdnk70Vz5RaVESw1R/tJq9kc+Y07LoWOIGsg= Original-Received: by 10.231.40.10 with SMTP id i10mr50672ibe.63.1291861858820; Wed, 08 Dec 2010 18:30:58 -0800 (PST) Original-Received: by 10.231.11.137 with HTTP; Wed, 8 Dec 2010 18:30:58 -0800 (PST) In-Reply-To: <87fwu8rzgw.fsf@stupidchicken.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133543 Archived-At: --000325575c5a31a47c0496f10744 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 8, 2010 at 8:39 AM, Chong Yidong wrote: > Fren Zeee writes: > >> 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 . http://www.gnu.org/software/emacs/emacs-lisp-intro/html_mono/emacs-lisp-intro.html#cons (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; --000325575c5a31a47c0496f10744 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Dec 8, 2010 at 8:39 AM, Chong Yidong <cyd@stupidchicken.com> wrote:
> Fren Zeee <frenzeee@gmai= l.com> writes:
>
>> cons expects the second argument to be a list
>
> No it doesn't.
>
> Please refer to An Introduction to Programming in Emacs Lisp, Cha= pter 7,
> "car, cdr, cons: Fundamental Functions".
>
 
Thanks a lot !
 
You can now see that I have read the link and highlighting shows I hav= e 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<= /code> puts a new element at the beginning of a list; it attaches or= pushes elements onto the list', but this phrasing can be misleading, <= font style=3D"BACKGROUND-COLOR: #33ff33">since cons does not c= hange an existing list, but creates a new one.

 
Build a list
 
cons must have a list to att= ach to.9 You cannot start from absolutely nothing. If you are buildi= ng a list, you need to provide at= least an empty list at the beginning. Here is a series of cons expr= essions 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 rea= d as `evaluates to'.
 
    (cons 'but= tercup ())
         ⇒ (buttercup)
   
    (cons 'daisy '(buttercup))
         ⇒ (daisy buttercup)
 
 The second example, (cons 'daisy '(buttercup)) constructs a new, two element list by putting daisy in fro= nt of buttercup;
 
--000325575c5a31a47c0496f10744--