[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "fall-through" generic function args plus &context

From: Eric Abrahamsen
Subject: Re: "fall-through" generic function args plus &context
Date: Tue, 27 Dec 2016 09:23:07 -0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux)

Stefan Monnier <> writes:

>> Come to think of it, how does one override `cl-no-applicable-method' for
>> a specific generic?
> Good question.
> I guess in CLOS, this works by creating a new class that derives from
> the standard "generic function" class, then make your generic function
> be an instance of *that* class, at which point you can then define your
> `cl-no-applicable-method` method which specializes on the class of the
> `generic` argument.
> But currently cl-generic does not support this notion of "generic
> function" quite the way CLOS does (for one our "generic functions"
> objects are `defstruct` rather than `defclass` objects, and also
> they're not callable so the function cell is yet different (a fairly
> standard closure)).

Thanks for the tips! Using fundamental-mode didn't work (at least not in
the emacs-lisp buffer I tested it in), but the empty arg-list did, so
that's sorted.

I haven't looked too hard at the specializer code, but if we can already
dispatch on defstructs, it seems like it wouldn't be that hard to make
something that dispatches on generics? But I really don't know...

Thanks again,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]