libera/commonlisp - IRC Chatlog
Search
18:39:03
jeosol
haha. I can't afford to put everything in clusters around the world, but it's possible later. Right now, resources reside in central US
22:58:21
TMA
in my experience, the answer to this type of technical question is either really obvious to the asker as soon as they ask it; in the remaining cases the answer is usually "no, try thinking more"
22:59:09
ecomcon
pjb: sure. In a graphical application, I have a BINARY-PARTITION class with two fields, PRIMARY and SECONDARY, that point to each subdivision. I've subclassed BINARY-PARTITION into VERTICAL-PARTITION and HORIZONTAL-PARTITION, which have no fields, for the purpose of implementing separate DRAW and PICK methods.
23:00:32
pjb
If you didn't have subclasses, you'd have to add an ORIENTATION slot, and in the single method, test for it. It's better in terms of OOP, to define the subclasses, indeed, to define specific methods for them.
23:01:20
ecomcon
At first, BINARY-PARTITION had an ORIENTATION field, which told DRAW how to behave, but I thought that was essentially the logic of multiple dispatch, so I turned them into subclasses
23:01:24
pjb
ecomcon: notice that in CL we also have CHANGE-CLASS, so you can change the orientation easily.