emacs-devel
[Top][All Lists]
Advanced

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

Re: Replace trivial pcase occurrences in the Emacs sources


From: Eli Zaretskii
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Thu, 01 Nov 2018 20:07:26 +0200

> From: "Garreau\, Alexandre" <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Thu, 01 Nov 2018 06:21:49 +0100
> 
> >> >   @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.

The values need to be extracted in one go, so the above doesn't
qualify.

> > "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.

:-)

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

It didn't look like a more clear description to me, no.



reply via email to

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