From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.bugs Subject: bug#20420: 25.0.50; eieio methods with optional arguments now fail Date: Sun, 26 Apr 2015 14:00:39 +0200 Message-ID: <87vbgjm74o.fsf@gmail.com> References: <87d22tpbqr.fsf@gmail.com> <878udhp0ay.fsf@gmail.com> <87sibonjz0.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430049695 10021 80.91.229.3 (26 Apr 2015 12:01:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Apr 2015 12:01:35 +0000 (UTC) Cc: 20420@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 26 14:01:21 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YmLFQ-0003P9-Bb for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Apr 2015 14:01:20 +0200 Original-Received: from localhost ([::1]:50637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmLFP-0001FI-L4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Apr 2015 08:01:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmLFD-0001EB-EE for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 08:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmLF8-0007Df-Ee for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 08:01:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmLF8-0007Db-BL for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 08:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YmLF8-0003nt-2k for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 08:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vitalie Spinu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Apr 2015 12:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20420-submit@debbugs.gnu.org id=B20420.143004965414601 (code B ref 20420); Sun, 26 Apr 2015 12:01:01 +0000 Original-Received: (at 20420) by debbugs.gnu.org; 26 Apr 2015 12:00:54 +0000 Original-Received: from localhost ([127.0.0.1]:40193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmLEx-0003nO-76 for submit@debbugs.gnu.org; Sun, 26 Apr 2015 08:00:53 -0400 Original-Received: from mail-wg0-f54.google.com ([74.125.82.54]:35770) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmLEt-0003n7-Es for 20420@debbugs.gnu.org; Sun, 26 Apr 2015 08:00:48 -0400 Original-Received: by wgyo15 with SMTP id o15so90407609wgy.2 for <20420@debbugs.gnu.org>; Sun, 26 Apr 2015 05:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=KDKfi95yGRNtRMZKGjWwlLNhBu5Ze4G2Alsgz6PWnvI=; b=CaSd29F20lNN8dkoFPVA2I8+kgVWCnnCiwn8ww04f/flIqqpbvubH101/2frjwzTAs LepuX1Dc31aj7+VwrMeHiu4mKqbqy8KtLEbwMrEDP17yfjjNoNRfH6WdNapwaFYM4Ee0 iQS44zA6dtHs6rn8h8iyM1IZlyGN+53AnceJsqXQv5Gi/plaDy2nO9DaNTGDLjJ2kVYH C5KhIY+JnM2d0ALgq3fPCc+td2MKn/lUgTBmUl6w80ktyO6y47difiVmtc/82x5Qzcwg jrJX6sdlUxI+qjMmzvysdNG8HP1rYWz/T1HwzO4tDxxTIT8BlSeJmbpq9JnIVFWwAxdE 3UeA== X-Received: by 10.180.74.37 with SMTP id q5mr12265484wiv.59.1430049641470; Sun, 26 Apr 2015 05:00:41 -0700 (PDT) Original-Received: from localhost (dhcp-077-251-128-242.chello.nl. [77.251.128.242]) by mx.google.com with ESMTPSA id l1sm7063175wiy.20.2015.04.26.05.00.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Apr 2015 05:00:40 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 26 Apr 2015 00:02:51 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102054 Archived-At: >>> Stefan Monnier on Sun, 26 Apr 2015 00:02:51 -0400 wrote: >>> That tells me *how* you used it, not *where*. >> I was using it in polymode package for a generic indentation >> functionality: >> https://github.com/vspinu/polymode/blob/master/polymode-methods.el#L530 > [ After figuring out that the code now doesn't do that any more and > seeing the old code which does do the "nasty" empty-args defmethod. ] Sorry about that. I wasn't expected you will be interested in so much detail. I would have been more elaborate. >> Aha. Cool! I will have a look. Is there a more elaborate documentation >> somewhere? > No, it's more a wishlist item: add support for formal pseudo-arguments > of the form "&context ( )". >> Particularly I don't see "specializer" and "generalizer" >> being properly defined anywhere. > "Specializer" is used commonly in CLOS to refer to the "thing" that can > be either a class type or (eql ). "Generalizer" is not standard > and refers to a thing that takes a value (the actual argument) and finds > its corresponding specializers (i.e. its type(s)). I took the term from > an article that extended CLOS method-matching. cl-generic.el does not > directly implement that article, but it's fairly similar. This sounds like a more involved version of what Clojure does with multimethods (also implemented in emacs multi.el package [1]) When Clojure's generic is defined you supply a dispatch function that takes all actual arguments and returns an object (commonly a symbol). The returned object is then used directly for dispatch. If I understand correctly the dispatch function is like your generalizer. Vitalie [1] https://github.com/kurisuwhyte/emacs-multi Better documented at https://github.com/vspinu/emacs-multi