From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] pcase.el: Add type pattern Date: Tue, 10 Mar 2020 18:43:23 +0100 Message-ID: <871rq0qf5w.fsf@web.de> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31378"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 10 18:47:04 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 1jBiy7-0007zc-I1 for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 18:47:03 +0100 Original-Received: from localhost ([::1]:37822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBiy6-0006mt-9O for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Mar 2020 13:47:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51792) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBiuY-0003Vc-Fn for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:43:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBiuW-0007c4-Ce for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:43:22 -0400 Original-Received: from mout.web.de ([212.227.15.3]:58529) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jBiuV-0007U7-Vu for emacs-devel@gnu.org; Tue, 10 Mar 2020 13:43:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1583862195; bh=1r1o3LGii1Ix4Qu1fwpdXRrjLVigVCTgbE5NM4cU1QA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=EvFjuzDQBzC0pA4ngRseFPo2wKnI7a35cnFJsWIPKZ3RsDSsoecmv3uyNfhMODiye WsWqBD/SBtHMMQABot3ULgtnb0xxwYihJjAfmXZEormAsUIBEdFWqAUpnT3wmoJ5pW g/ciTH6WlvjLVvOvlnh8J0e/kXWI9aQTtQxIV3us= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([92.208.89.41]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LvBJK-1jJnpR11G6-010KOz; Tue, 10 Mar 2020 18:43:15 +0100 In-Reply-To: <87o8t487mb.fsf@alphapapa.net> (Adam Porter's message of "Tue, 10 Mar 2020 12:03:40 -0500") X-Provags-ID: V03:K1:tGQZaeIN6GZUIaYUy1mk9LDbWJiIriplCRXFaqxfuD/8TMuJdyQ 3z4ejS3EUiI+XASM8j1HA3BH2nR4P2ECk83nzE+KFlEPwr54yxtGZ0EpIQ0/SAO53SnUR23 6mnVpT6fJmx1DoAYmqnzhRfqimgNAY7gmGzqO41W9VZKP2+7sYcdYVzGcAGMHv+nn5Oyjg+ 5WJleTp8zzaap5y8MkfjA== X-UI-Out-Filterresults: notjunk:1;V03:K0:FqYk28kgXco=:2EV3FUNdVg3EM8awTBanci khuNr/HxZdDzMM1jvhXYhh3gxXCG2lM+OiLkhUS4XlHlPucAL31Y/++iWxlAjUOnespDHyfUB LgiuK2TIzbmMPxojsG4S2kXouFq5MjJsARWQ6vtE5Z4t7YgqEtGiODZp0+zdMbHXX0xjJtKuT 2tCbPPmIoYYIOLD0eUyGTzDxmgpsO3zpRhcGV2cXZFpyNn2lo8+IIStTZOktYoZwJX+fNnFba Tn/WkBBxGW7WRJqLm5YDmbv70e2dMs/LorP7c6imHxJEOhbYK8oHWbmDOWmtYA34DphTcIjix ELQEi6ZAtt/QlhPBnQo7s0wbjIDjcs9oi4Tex8B+dUn10sLrRGVQ6Jn5t4TSQ9CsBWLCSt9fu fjRPIIJVxrmvkK8JjlKchQLwSnVAED342GEc5hg76f0cZBYxam+gGc2tZ4Xh4zZyUZWrcI34x WWMCpoKqHdfwYAYBuiLEpcbMn8fhTjj4iWccr9dBSuxZsFSp5Iry1+VAD8/2WeAzAAU43rxpP z3tCxfBgzTDY24HmNUZomqqs8tZQ89bda7aE6/3gFvw0BDOrFR0lhS5GAa8BzFs/8kT/9wnEj yVksX0V9t7n3RfiMl6xcOa9zyUyA/qgF6nvFLIsx7Px/pThB9YR1zKdg0xYgLoqWmRZPRdNwg Vf+p8aJqS9bO1qElyYfLZXY8T7VeByN4dI1zhq6bkamcav6vjyP/Lsa64ySoL6qxN1hdE5QU4 8XDu15x9CESec7VTsx7RtaVBakeDGd7G50t5JHR3SM5g+z3Fe9xlP5omsKKqz+PhXpcymegU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.3 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:245435 Archived-At: Adam Porter writes: > My understanding was that adding the (require 'cl-lib) form was > suggested if the definition was left in pcase.el, and if the definition > were added to cl-macs.el instead, the (require 'cl-lib) form would not > be needed. Oh, I missed that, then sorry for the noise. > 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. > However, I have attached another version of the patch which adds an > autoload for the (pcase-defmacro type) form, which seems proper since > the (pcase-defmacro cl-struct) form in the same file also has one. What effect does this have? Since it's no defmacro from, the form is just copied literally to the generated loaddefs file, right? Wouldn't that make a an explicit `require' in the definition necessary? Michael.