emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 9dd95bf: * lisp/emacs-lisp/pcase.el (pcase--u1)


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master 9dd95bf: * lisp/emacs-lisp/pcase.el (pcase--u1): Fix bignums
Date: Fri, 26 Oct 2018 22:03:32 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Fri, 26 Oct 2018 14:23:26 -0400
> 
> >> Would you feel the same if `pcase` always used `equal` and the
> >> optimization to `eql` were performed in the byte-compiler instead?
> > I don't know, and it's not really relevant, is it?
> 
> It is: the use of `eq` or `eql` here is an optimization which pcase
> performs only because the compiler doesn't do it.

I disagree.  We describe our code, not what the compiler produces out
of it.

> >   ‘KEYWORD’
> >   ‘INTEGER’
> >   ‘STRING’
> >        Matches if EXPVAL is equal to the literal object.  The equality
> >        predicate depends on the type of the object; e.g., symbols are
> >        compared using 'eq', and strings using 'equal'.
> 
> I think we should say here that the semantics is that of `equal` and not
> that of `eq` (or `=` or whatever else).
> 
> The above would allow `pcase` to use `eq` for integers.

Where does it say something that has that effect?

> IOW if pcase uses `eq` on integers (as it did until yesterday) and
> some code uses pcase to match a bignum, the above would let us say
> that the bug is in the pcase use rather than in the pcase
> implementation.
> 
> Compared to the current doc, it also leaves it unclear whether 1.0 would
> match the '1 pattern.

So you now agree to describe in detail what predicate is used for each
data type?  I'm okay with that; I proposed the above because I
interpreted your original response as an objection to such detail.



reply via email to

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