help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: About "consing"


From: Doug Lewan
Subject: RE: About "consing"
Date: Thu, 28 Feb 2013 14:43:02 +0000

You've got it. That's exactly what consing means.

It's actually more general than the use that you've mentioned. 

A CONS cell has two parts: (1) its CAR (a value) and (2) its CDR (a pointer to 
the next CONS cell). (The names are historical. I don't know if their 
etymologies matter anymore.) A list is built from CONS cells; the CAR is the 
first element and the CDR is the rest of the list (which is itself a list).

I know that's a little abstract without motivation. See the emacs lisp info on 
Lists (which has a section on CONS cells). The section on Building Lists has a 
picture that shows the connection between CONS cells and lists.

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224

When I do good, I feel good. When I do bad, I feel bad and that's my religion. 
- Abraham Lincoln

> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
> Behalf Of Xue Fuqiao
> Sent: Thursday, 2013 February 28 09:23
> To: help-gnu-emacs@gnu.org
> Subject: About "consing"
> 
> In the doc string of the function `memory-use-counts':
> 
>   Return a list of counters that measure how much consing there has
> been.
> 
> I don't know what the "consing" means here.  I only know that `cons' is
> often
> used to add a single element to the front of a list.  But this seems to
> be
> irrelevant to the topic.
> 
> And in (info "(elisp) Garbage Collection"):
> 
>  -- Function: memory-use-counts
>      This returns a list of numbers that count the number of objects
>      created in this Emacs session.
> 
> Does "consing" mean creating an object here?  Thanks.
> 
> --
> Best regards, Xue Fuqiao.
> http://www.emacswiki.org/emacs/XueFuqiao




reply via email to

[Prev in Thread] Current Thread [Next in Thread]