Gnus development mailing list
 help / color / mirror / Atom feed
From: Steinar Bang <sb@dod.no>
To: ding@gnus.org
Subject: Re: Backquotes and commas and ",@"
Date: Sat, 10 Dec 2011 10:52:46 +0100	[thread overview]
Message-ID: <87obvgkb2p.fsf@dod.no> (raw)
In-Reply-To: <m2r50c7q6i.fsf@igel.home>

>>>>> Andreas Schwab <schwab@linux-m68k.org>:
> Steinar Bang <sb@dod.no> writes:

>> This means that the gnus-sync-lesync-pre-save-group-entry function
>> returns a list.

> More specifically, it returns an alist of key/value pairs.

Right!  That makes sense.

>> - Then the list will have an element that is a two element list,

> It's a cons whose car is the key and cdr is the value.

Right!  And a cons cell isn't a two element list.  A two element list
would have been two cons cells, with the car of each cell holding the
elements.

>> consisting of the symbol '_id and the first element of the nentry
>> argument to the function (I don't understand why you have to have
>> the "." there, though...?)

> Because you want the cdr to be the value of the key, not the cadr.

And refreshing my lisp knowledge:
 - cdr is the second slot of a cons cell, ie. the one pointing to the
   next cons cell of the list
 - cadr is the car of the cdr ie. (cadr '(1 2)) is 2.  However '(1 2)
   creates a two element list (ie. two cons cells with the car of the
   first cons cell being 1 and the car of the second cons cell being 2).
   And indeed (cadr (1 . 2)) fails (as one would expect from cadr's
   definition

Ah... "value of the key" is somewhat ambigous.  I took that to mean,
well... the value of the key.  While you meant the value that can be
looked up, using the key, and in which case your sentence makes sense.

So... I looked up the definition of alist, and it's indeed a list of
cons cells (which isn't surprising when one stops to think about it).

> Splicing the empty list will splice nothing.

I suspected that this might be the case, but didn't stop to look it up.




  reply	other threads:[~2011-12-10  9:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 19:55 gnus-sync-save fails with "wrong-type-argument number-or-marker-p" Steinar Bang
2011-11-23 20:27 ` Steinar Bang
2011-12-06 21:17   ` Steinar Bang
2011-12-08 14:50     ` Ted Zlatanov
2011-12-08 19:07       ` Steinar Bang
2011-12-10  7:11         ` Steinar Bang
2011-12-10  7:29           ` Steinar Bang
2011-12-10  8:10             ` Backquotes and commas and ",@" (Was: gnus-sync-save fails with "wrong-type-argument number-or-marker-p") Steinar Bang
2011-12-10  9:04               ` Backquotes and commas and ",@" Andreas Schwab
2011-12-10  9:52                 ` Steinar Bang [this message]
2011-12-10 10:39               ` Ted Zlatanov
2011-12-10 11:07         ` gnus-sync-save fails with "wrong-type-argument number-or-marker-p" Ted Zlatanov
2011-12-10 14:19           ` Steinar Bang
2011-12-10 14:45             ` Steinar Bang
2011-12-10 14:49               ` Steinar Bang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obvgkb2p.fsf@dod.no \
    --to=sb@dod.no \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).