[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The poor state of documentation of pcase like things.
From: |
Eli Zaretskii |
Subject: |
Re: The poor state of documentation of pcase like things. |
Date: |
Sat, 19 Dec 2015 19:19:46 +0200 |
> Date: Sat, 19 Dec 2015 19:08:18 +0200
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden, address@hidden
> > > > (pcase value
> > > > (`(1 2 ,foo 3)
> > > > (message "Matched 1, 2, something now bound to foo, and 3"))
> > > > (foo
> > > > (message "Match anything at all, and bind it to foo!"))
> > > > (`(,the-car . ,the-cdr))
> > > > (message "Match any cons cell, binding the car and cdr locally"))
> > >
> > > So to bind something to 'foo' you just use "foo", but to bind
> > > something to 'the-car' and 'the-cdr' you need to use ",the-car" and
> > > ",the-cdr"? Why the inconsistency?
> >
> > The examples only differ because some symbols occur inside backquote and
> > others don't.
>
> ",foo" in the first pattern is also inside a backquote, but it is
> still different from "foo" in the second pattern and ",the-car" in the
> third. So I'm still not out of the woods regarding the inconsistency.
(Time passes...) Ah, I see: I was confused by John's different style:
"now bound to foo" vs "bind it to foo". These actually intend to say
the same thing: "match anything and bind it to foo", but the former
wording made it sound like it was already bound to foo before, i.e. as
if the first pattern _uses_ the existing binding of foo, instead of
binding foo.
Silly me, trying to assign too much importance to the wording.
- Re: The poor state of documentation of pcase like things., (continued)
- Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/19
- Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2015/12/18
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., John Wiegley, 2015/12/22
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2015/12/19
- Re: The poor state of documentation of pcase like things.,
Eli Zaretskii <=
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., John Wiegley, 2015/12/22
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2015/12/19
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., John Wiegley, 2015/12/22
- Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/19
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2015/12/19
- Re: The poor state of documentation of pcase like things., Phillip Lord, 2015/12/19