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


View this message in rfc822 format

From: Vitalie Spinu <spinuvit <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 20420 <at> debbugs.gnu.org
Subject: bug#20420: 25.0.50; eieio methods with optional arguments now fail
Date: Sat, 25 Apr 2015 20:25:39 +0200
 >>> Stefan Monnier on Sat, 25 Apr 2015 10:41:40 -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

 >> 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)) ...)

Aha. Cool! I will have a look. Is there a more elaborate documentation
somewhere? Particularly I don't see "specializer" and "generalizer"
being properly defined anywhere.


  Vitalie




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.