From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: pcase defuns Date: Sun, 19 Dec 2021 18:16:29 +0100 Message-ID: <87y24g4hsb.fsf@gnu.org> References: <871r299e5j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29238"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.5; emacs 29.0.50 Cc: emacs-devel@gnu.org To: Andrew Hyatt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 19 18:38:36 2021 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 1mz08q-0007SH-4E for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Dec 2021 18:38:36 +0100 Original-Received: from localhost ([::1]:58250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mz08o-0008R9-Hz for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Dec 2021 12:38:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mz08G-0007j5-Jq for emacs-devel@gnu.org; Sun, 19 Dec 2021 12:38:00 -0500 Original-Received: from [2001:470:142:3::e] (port=40834 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mz08G-00019s-8L; Sun, 19 Dec 2021 12:38:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=LCUDt5eu7VGdVMap36GL/xybWp6TWcEW1T1HHgBYJoA=; b=W4jfMExxbEBns8 48mNqOS67wSX5vcJL3uUs0zMli0MuDwNCvLPZ57fZeqLQhJ9TlM0uvigfLUIlqC8mDPCM+hslawzY BLS+JtCAN0EFdV4OR3BbZpnpK698p22QhTkn9obPbo3RqNhHUrtrzhv26X0/oieMiehhlNVQcbfGc uUtXP3sFWDO2OlWENbDIdjZW49wcd8/wEUsWZkWXbMULI92np0ruEqPHFBVEIX/EXs1k9o0Rxd/CI s5sK38ylwFraQIJ/yujY+0EkLE2Aim7ITVQxhfAOB5D19Mep6r4j/ESwsV9cTPUx1IB1MRQJxcTD/ rBFxpsy3LZU7ipvhlMag==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:48753) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mz08G-0001p6-C4; Sun, 19 Dec 2021 12:38:00 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 6C19A27C0054; Sun, 19 Dec 2021 12:37:59 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 Dec 2021 12:37:59 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddttddguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe evveeikeetkeeviefgfeffiedvteeguddvffeuueduveegtddthedvhfeuveffhfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Dec 2021 12:37:58 -0500 (EST) In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:282461 Archived-At: Andrew Hyatt writes: Hi Andrew, > I have a solution for this: a crude one: I just sort all the rules > according to their flattened length. So the most complicated ones > should get tried first, which I think is something that can > communicated to the user. Hm, well, in that case (a ,var) is longer than (a b) so the former will always be taken although a user might have them ordered the other way round and expect (a ,var) only to match if the second argument is not b. > You've hit upon the issue with these types of systems. Powerful, easy > to use, but dispatch rules are always vague. The same thing can > happen with cl-defmethod, IIRC, where you can have two rules that both > seem like they should take precedence. Oh dear, my head becomes dizzy when reading their dispatch behavior at (info "(elisp) Generic Functions"). Well, I mean, the typical uses can be pretty easy to understand but if you mix and match different kinds of specifiers, it becomes unwieldy, like what happens when you have two methods where one specifies the first argument must be an integer and the other says it applies if the first argument is (eql 42) [where 42 is obviously an integer]? I can't read a priority order between different kinds of specifiers... Bye, Tassilo