From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] pcase.el: Add type pattern Date: Tue, 10 Mar 2020 13:17:32 -0500 Message-ID: <87d09k8477.fsf@alphapapa.net> References: <874kuxxuez.fsf@alphapapa.net> <87r1y1wcj4.fsf@alphapapa.net> <87h7yxw5x1.fsf@alphapapa.net> <87a74puq1q.fsf@web.de> <87d09lw3id.fsf@alphapapa.net> <87zhcoqmmz.fsf@web.de> <87wo7s8b73.fsf@alphapapa.net> <87eeu0qisn.fsf@web.de> <87o8t487mb.fsf@alphapapa.net> <871rq0qf5w.fsf@web.de> <87h7yw84sb.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="62491"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 19:18:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBjSc-000GA4-Ch for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 19:18:34 +0100 Original-Received: from localhost ([::1]:38200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBjSZ-00017U-FT for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 14:18:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36645) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBjRm-0000Y0-Qw for emacs-devel@gnu.org; Tue, 10 Mar 2020 14:17:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBjRl-0002T8-Ty for emacs-devel@gnu.org; Tue, 10 Mar 2020 14:17:42 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:59694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBjRl-0002OD-Nn for emacs-devel@gnu.org; Tue, 10 Mar 2020 14:17:41 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jBjRj-000EyU-Un for emacs-devel@gnu.org; Tue, 10 Mar 2020 19:17:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245438 Archived-At: Hi Michael, Adam Porter writes: >>> 1. Run emacs -Q. >>> 2. Evaluate this form in *scratch*: >>> >>> (pcase-defmacro type (type) >>> "Pcase pattern that matches objects of TYPE. >>> TYPE is a symbol or list as accepted by `cl-typep', which see." >>> `(pred (pcase--flip cl-typep ',type))) >>> >>> 3. Evaluate this form in *scratch*: >>> >>> (macroexpand-all '(pcase 10 ((type (integer 0 10)) t))) >>> >>> Result: >>> >>> (if (and (integerp 10) (>= 10 (quote 0)) (<= 10 (quote 10))) (progn t) >>> nil) >> >> No, I don't see that here. I'm using current master here. > > Hm, I don't know how to explain that. I guess I'll have to rebuild > master and check again. Here are the steps I just followed: 1. Pull master and rebase my patch on it. 2. ./configure && make && src/emacs -Q. 3. Evaluate this expression, in both *scratch* and M-:, which give the same result: (macroexpand-all '(pcase 10 ((type (integer 0 10)) t))) Result: (if (and (integerp 10) (>= 10 '0) (<= 10 '10)) (progn t) nil) I can't explain why you get a different result.