GNU bug report logs - #20420
25.0.50; eieio methods with optional arguments now fail

Previous Next

Package: emacs;

Reported by: Vitalie Spinu <spinuvit <at> gmail.com>

Date: Fri, 24 Apr 2015 19:29:01 UTC

Severity: normal

Found in version 25.0.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 20420 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Vitalie Spinu <spinuvit <at> gmail.com>
Cc: 20420 <at> debbugs.gnu.org
Subject: Re: bug#20420: 25.0.50; eieio methods with optional arguments now fail
Date: Sat, 25 Apr 2015 10:41:40 -0400
>> Hmmm... I think this really only worked by accident and wasn't
>> explicitly supported by Emacs-24's doc.  And adding support for such
>> degenerate methods might not be straightforward in eieio-compat.el, so
>> I'm wondering where you've seen such use, to see how important it is to
>> provide that level of backward compatibility.
> I was using function xx that, when called with no arguments, dispatched
> methods with the same name on a local object in the current buffer.

That tells me *how* you used it, not *where*.

> As we are on this topic how about allowing for implicit dispatch on the
> arbitrary context? I mean something along the following lines:

Quoting from cl-generic.el:

   ;; TODO:
   [...]
   ;; - A way to dispatch on the context (e.g. the major-mode, some global
   ;;   variable, you name it).
   [...]
   ;;; Just for kicks: dispatch on major-mode
   ;;
   ;; Here's how you'd use it:
   ;;   (cl-defmethod foo ((x (major-mode text-mode)) y z) ...)
   ;; And then
   ;;     (foo 'major-mode toto titi)
   ;;
   ;; FIXME: Better would be to do that via dispatch on an "implicit argument".
   ;; E.g. (cl-defmethod foo (y z &context (major-mode text-mode)) ...)

IOW, patch welcome.


        Stefan




This bug report was last modified 9 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.