all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* About "consing"
@ 2013-02-28 14:23 Xue Fuqiao
  2013-02-28 14:43 ` Doug Lewan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Xue Fuqiao @ 2013-02-28 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: About "consing"
  2013-02-28 14:23 About "consing" Xue Fuqiao
@ 2013-02-28 14:43 ` Doug Lewan
  2013-02-28 14:47 ` Stefan Monnier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Doug Lewan @ 2013-02-28 14:43 UTC (permalink / raw)
  To: Xue Fuqiao, help-gnu-emacs@gnu.org

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About "consing"
  2013-02-28 14:23 About "consing" Xue Fuqiao
  2013-02-28 14:43 ` Doug Lewan
@ 2013-02-28 14:47 ` Stefan Monnier
  2013-02-28 15:05 ` Kevin Rodgers
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2013-02-28 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

>   Return a list of counters that measure how much consing there has been.

Here, "consing" means "cons"truct"ing", i.e. calls to constructors.

> Does "consing" mean creating an object here?  Thanks.

Yup,


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About "consing"
  2013-02-28 14:23 About "consing" Xue Fuqiao
  2013-02-28 14:43 ` Doug Lewan
  2013-02-28 14:47 ` Stefan Monnier
@ 2013-02-28 15:05 ` Kevin Rodgers
  2013-02-28 15:57 ` Eli Zaretskii
       [not found] ` <mailman.21101.1362063945.855.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2013-02-28 15:05 UTC (permalink / raw)
  To: help-gnu-emacs

On 2/28/13 7:23 AM, Xue Fuqiao wrote:
> 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.

Yes: allocating a cons cell.

-- 
Kevin Rodgers
Denver, Colorado, USA




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About "consing"
  2013-02-28 14:23 About "consing" Xue Fuqiao
                   ` (2 preceding siblings ...)
  2013-02-28 15:05 ` Kevin Rodgers
@ 2013-02-28 15:57 ` Eli Zaretskii
       [not found] ` <mailman.21101.1362063945.855.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2013-02-28 15:57 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 28 Feb 2013 22:23:12 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
> 
> 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.

Always try the help features first.  "i consing RET" will land you
where this terminology is described.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About "consing"
       [not found] ` <mailman.21101.1362063945.855.help-gnu-emacs@gnu.org>
@ 2013-02-28 16:10   ` Barry Margolin
  0 siblings, 0 replies; 6+ messages in thread
From: Barry Margolin @ 2013-02-28 16:10 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.21101.1362063945.855.help-gnu-emacs@gnu.org>,
 Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:

> On 2/28/13 7:23 AM, Xue Fuqiao wrote:
> > 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.
> 
> Yes: allocating a cons cell.

And arrays, buffers, etc.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-28 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-28 14:23 About "consing" Xue Fuqiao
2013-02-28 14:43 ` Doug Lewan
2013-02-28 14:47 ` Stefan Monnier
2013-02-28 15:05 ` Kevin Rodgers
2013-02-28 15:57 ` Eli Zaretskii
     [not found] ` <mailman.21101.1362063945.855.help-gnu-emacs@gnu.org>
2013-02-28 16:10   ` Barry Margolin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.