[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CLX draft 3 revisions
Well in fact, many people would say that surely a concept such as
'height' is NOT the same when talking about different sorts of things.
(height (make-instance 'elm-tree)) ;in FEET
(height (font-ref *default-hardcopy-font* #\a)) ;in INCHES
(height (make-instance 'window)) ;in PIXELS
They are really quite different.
Now some people are willing to overload the single generic function
height to be able to have all these different meanings.
Other consider that bad style, and would have window-height be a
generic-function which returns the height of any kind of window;
hardcopy-height be the generic-function which returns the height of
anything that can be sent to a hardcopy stream etc.
It is clear that both of these positions are reasonable. In fact, when
you want to do it one way versus another depends on lots of factors like
the size of the module you are working on. Whether the symbols in
question will be exported or imported etc.
:accessor-prefix in CLOS is designed to make it easy to program in
either of those styles.
Note that using (:accessor-prefix nil) is the way to get the behavior