GNU bug report logs -
#20420
25.0.50; eieio methods with optional arguments now fail
Previous Next
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
>>> 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 (<exp> <specializer>)".
>> 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 <value>). "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
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.