3 ms·
There are no class browsers for Lisp because deep class hierarchies are very rare. One example: In many OO APIs it is idiomatic (if not mandatory) to subclass
by aidenn0 12y ago
There are no class browsers for Lisp because deep class hierarchies are very rare.
One example: In many OO APIs it is idiomatic (if not mandatory) to subclass a base-class in the API in order to customize its behavior. This is extremely rare in lisp. Behavior is more commonly customized by just defining functions and either assigning them to slots, or defining new methods on generic functions for classes that are not typically descendants of classes in the API.
I've been developing in lisp for years, and I can count on one finger the number of times I've subclassed a class written by someone else, and I've never said "This would be so much easier to understand if only I had a class browser"
- lispm 12y ago> There are no class browsers for Lisp because deep class hierarchies are very rare. That's actually false. Deep class hierarchies are quite common in object-oriented Lisp. Also there are class browsers for Lisp. > ... to subclass a base-class ... This is extremely rare in lisp. It is isn't. For example, an application's condition classes will always be a subclass of something. Only relatively primitive applications will not introduce new condition classes. > I can count on one finger the number of times I've subclassed Then you have never used CLOS or any CLOS-based libraries.
- aidenn0 12y ago> Then you have never used CLOS or any CLOS-based libraries. Does using DEFGENERIC/DEFMETHOD make it CLOS based? If so, then I have used CLOS and CLOS based libraries; they just weren't particularly object-oriented. I know that there is more strongly object-oriented lisp code out there, but I personally haven't run into it. I'll agree that "Deep class hierarchies are quite common in object-oriented Lisp." since that is very nearly tautological. I'm not certain, however, how common object-oriented lisp is. Even within common-lisp there really isn't a single idiomatic style that is used. Care to share some examples of more heavily object-oriented lisp projects?
- rjsw 12y agoThere are plenty of objects in CLIM.
- lispm 12y agoLispWorks has a class browser. Its class library has several deep hierarchies with lots of classes. For example the class for a UI button is called CAPI:BUTTON. It has 11 CAPI superclasses and its depth for CAPI classes is six. It also has five subclasses adding more depth. The minute you write a GUI application in LispWorks, you'll use a macro called DEFINE-INTERFACE. What does it do? It creates a CLOS class for your application, which inherits from CAPI:INTERFACE. You want a new window pane type? Define a subclass of CAPI:OUTPUT-PANE. For another example: check the class hierarchy of stream classes in Clozure Common Lisp.