From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 9dd95bf: * lisp/emacs-lisp/pcase.el (pcase--u1): Fix bignums Date: Fri, 26 Oct 2018 22:03:32 +0300 Message-ID: <83pnvwo7i3.fsf@gnu.org> References: <83bm7hozav.fsf@gnu.org> <83zhv0oink.fsf@gnu.org> <83va5ooboc.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1540580500 18421 195.159.176.226 (26 Oct 2018 19:01:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2018 19:01:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 26 21:01:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gG7MW-0004eT-CS for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2018 21:01:36 +0200 Original-Received: from localhost ([::1]:33810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG7Oc-0001n6-Ra for ged-emacs-devel@m.gmane.org; Fri, 26 Oct 2018 15:03:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG7OT-0001mx-QI for emacs-devel@gnu.org; Fri, 26 Oct 2018 15:03:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG7OQ-0000pr-ET for emacs-devel@gnu.org; Fri, 26 Oct 2018 15:03:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG7ON-0000nj-4J; Fri, 26 Oct 2018 15:03:31 -0400 Original-Received: from [176.228.60.248] (port=3993 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gG7OL-0002Dq-Ga; Fri, 26 Oct 2018 15:03:30 -0400 In-reply-to: (message from Stefan Monnier on Fri, 26 Oct 2018 14:23:26 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230723 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > 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.