emacs-devel
[Top][All Lists]
Advanced

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

Re: Subprojects in project.el


From: João Távora
Subject: Re: Subprojects in project.el
Date: Fri, 2 Dec 2022 23:26:07 +0000

On Fri, Dec 2, 2022 at 3:44 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
Indeed.  AFAIK the general approach for APIs that rely on CLOS-style OO
programming is that all the classes are kept "abstract" and what you see
is only generic functions.  IOW the API is exclusively defined by the
generic functions.

Yes, and such an API is called a "protocol" in CLOS parlance.  But the
exclusivity you suggest isn't true: classes and inheritance are a big
part of CLOS and CLOS-style OO.  IME,  CLOS's power is only fully
realized when you use both.

In Emacs Lisp's flavour of CLOS,  generic functions have somewhat
esoteric  dispatching mechanisms that I've never seen or needed in a
CLOS system when using classes, inheritance, and method combinations.

So +1 for using classes in more Elisp packages.  See for example how
eglot.el subclasses jsonrpc.el's classes. It's not as easy as in Common
Lisp since we don't have things like the beautiful inspector of SLY/SLIME.
But classes still beat those funky cons by a mile IMHO.

João

reply via email to

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