From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Generic functions: Specializers like `or' or `memq'? Date: Sat, 06 Nov 2021 23:32:31 +0100 Message-ID: <878ry0nce8.fsf@web.de> References: <87r1bxcg6g.fsf@web.de> <87y265aymg.fsf@posteo.net> <87ilx9hrn6.fsf@web.de> <87a6ilorh0.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29498"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Stefan Monnier To: Stefan Monnier via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 06 23:33:19 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1mjUFT-0007S9-9q for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 23:33:19 +0100 Original-Received: from localhost ([::1]:43996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjUFR-0005YV-8V for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 18:33:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjUEs-0005YL-Cl for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 18:32:42 -0400 Original-Received: from mout.web.de ([212.227.17.12]:59473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjUEp-0008BK-VP for help-gnu-emacs@gnu.org; Sat, 06 Nov 2021 18:32:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1636237953; bh=PAMtjepmTPgjypFWAVwO7LsGm9fLNWwgMfMJgErESgo=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=pofm8jLK9C4EPG3ai7rZLX/oUx6y6wnSL3e22h/lR6FNqc8/0v4p7pueV/SZDiUCe ZQxR052ork503Yez+DBg5zHQoUXWRcbVALtakuCRZur81jVZJiSjXD3CarJ7ZgHCmn 3uiyV9GqO/EJqL9fVowO7Sdh6VZ+qQNVRuDIhSp4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([92.208.225.87]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MUUAM-1n9zLl0y1o-00QvRL; Sat, 06 Nov 2021 23:32:33 +0100 In-Reply-To: (Stefan Monnier via Users list for the's message of "Wed, 03 Nov 2021 21:31:50 -0400") X-Provags-ID: V03:K1:+vO9uHSoYmkx31DC4KHgK2k/OwTAEfGM11AgRPZcolZ3K7cXBaR y8PjMikhAotRajSVDvHuzM/iEOuoAFj+3HIFbY8lFHS0kAmj5MrP4F5Tve80FVIxfwx14+C lwX0LKziX5DRFC/9GxELy1XFZdeizXuuFaq8GHHp47bfJpLoME5hUfKoachDt5qEgnBdPPw SYz0Le+NsjXybaOY7+rUA== X-UI-Out-Filterresults: notjunk:1;V03:K0:k7R8JHtcVYY=:3vPNcK8OuedL97yTDFO+wV 0RtXpVPP4uqTnMvLjEkQiJMleSC/FcHM/UkzEj1NaXtCKwXu/UTa/NC/LoTDM8pUQeYKRRSLK +v78R9Ls6W+rF9fZvOTqbsOh9Me4qUX6dJD8isRKJu5zzRYgk4TSBoPNc1eWuD8oP+GXqWJML bTup6ls/OgpeDE0OOPUJexqiSaiQqAeTj0pAGCr2Y0WtTcwB7DiboiJOcxZjYS64EzvA7B4Lq HyJE/GaWgyiPkUk+hoMO+NbZVCA56RNGlC12Y43Pd/1ZuSNpAyRbeMGB4FjkSAo+opWZ0gMFh m7Vs3wLNOthTndtJATNfOmIpBL9OtmT2DceRiv3PTmNOmiyVCCNN9i7IWfDLdZ0pPgdXxwBZF x2QVBK4EQKLzOSaEDpfhrmfqLPXpPf1Pzrjov+2VBhz8nDXT/6YftOZt6os88TdYt2Sw8ikKM sGnrn7D3RrMnxWrhz2YL9Q0v8VgCWYhoEnT7a3rkn72qIQOPuMlyn7ROlpPDPvjKNAmwRimXu QDoKvUHgBbOzt4MeRIBkKHwLkipyh9tP6xn2axhsph/1pTpIp1KGOVVGUklAZlQAPWSraUNmT GtluYkBSTKTwMokIOqUKnky8O7v54e2L6Bq+xPG1iDauWllwqTEVKywI9dwHx27KtE05q3MeP wdjTrmub3GhmSGksVQ8anOzlCLyFnyxeiTvh/2rit+8LkLfQD1KaGaovKDX4TNJIPtpjDIQNB n718jxUmiAbP9FOpE4ysx79lIbXRtYiEzo/KLBThG9WllMh8mDLxcYa/bWW1H3hulEoNcNsu Received-SPF: pass client-ip=212.227.17.12; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134421 Archived-At: Stefan Monnier via Users list for the GNU Emacs text editor writes: > The main problem is one of ordering between different methods when > several methods are applicable. > [ `cl-generic.el` solves this problem by forcing the generalizer to > come with a priority (a number), which makes the ordering "trivial" > for `cl-generic.el` but it can be hard to choose the right priority > to use when defining a new specializer/generalizer. ] I don't see this. How would an `or' or `memql' specializer be different from implementing the method several times for each alternative using the same body? There would be a problem only if the domains of the specializers would not be disjoint. But that can already happen now. I don't see why we would make the situation worse, unless the programmer does really strange things like listing the same (sub)specializer in mutliple `or' specializers. This could be warned about. I guess I have missed something. Michael.