[Top][All Lists]

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

Re: Replace trivial pcase occurrences in the Emacs sources

From: Garreau\, Alexandre
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Thu, 01 Nov 2018 06:21:49 +0100
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian

On 2018/11/01 at 06:10, Eli Zaretskii wrote:
>> From: "Garreau\, Alexandre" <address@hidden>
>> Cc: Stefan Monnier <address@hidden>,  address@hidden
>> Date: Thu, 01 Nov 2018 02:40:23 +0100
>> On 2018-10-30 at 21:54, Eli Zaretskii wrote:
>> > No, I think "destructuring" is about right.  How about this text:
>> >
>> >   @dfn{Destructuring} of an object is an operation that extracts
>> >   multiple values stored in the object, e.g., the 2nd and the 3rd
>> >   element of a list or a vector.  @dfn{Destructuring binding} is
>> >   similar to a local binding (@pxref{Local Variables}), but it gives
>> >   values to multiple elements of a variable by extracting those values
>> >   from an object of compatible structure.
>> “(car list)” is extracting a value stored in an object, yet it’s not
>> destructuring (though a list is a structure).  Nor even is “(cons (car
>> list) (caddr list))” or “(setq a (nth 1 list) b (nth 2 list))”.
> You forget the "multiple" part in the description.

Then you forgot “(cons (car list) (caddr list))” which I proposed later.

> "Destructuring" is not a term that Emacs invented.

Yes, learnt it reading stuff about python and ocaml, afair.

> You can look it up on the Internet; I think you will find that the
> adopted definitions are similar to what I wrote.

Yes, and these are wrong.

> So we don't need to try too hard in this case, as someone else already
> did that for us.

Not “too hard”, nor “hard” at all, nor even correctly.  Or then, any
reference (hence extraction) to something inside a structure, when done
several time, is destructuring, and as this ought to be possible if
structures exist, any language with structures / compound data, does
destructuring all the time.  But when talking about destructuring such
as in cl-destructuring-bind, pcase, python/ml/js multiple-assignments,
this is different.

Wasn’t my definition attempt okay? it even defined three quite used and
intuitive terms.

reply via email to

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