[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20420: 25.0.50; eieio methods with optional arguments now fail
From: |
Vitalie Spinu |
Subject: |
bug#20420: 25.0.50; eieio methods with optional arguments now fail |
Date: |
Sat, 25 Apr 2015 20:25:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>>> 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