libera/#lisp - IRC Chatlog
Search
8:18:28
binarydigitz01
Hey folks, I am a lisp newbie and I wanted to ask a question of how would you got about to implement this feature: I want to create Multiple Screens in My current game. Usually what I did was create a base class for screen, then extended/implemented it as a super class for every screen I did, and override the base functions. I can do this the same way using defgeneric and defmethod, but I wanted to ask, is there a specific lisp wa
9:38:03
mrcom
Probably the same way. The biggest difference between CLOS and other object systems is that methods can specialize on multiple things, and there's syntatic sugar for wrapping a method around a base method.
9:39:43
mrcom
i.e., when a "(defmethod :before ...)" finishes then CLOS automatically calls the primary method.
9:43:25
mrcom
From a "headspace" standpoint, you'll need to internalize that a class definition does not include methods.
9:46:03
mrcom
If you say "class triangle implements graphic-object", then what you're really saying is that you pinky-swear that, for all the graphic-object generic functions, there's a method that can do that for a triangle.