[Prev][Next][Index][Thread]
Re: [Q]Why are all classes rooted by <object>
In article <z6L87.23281$J37.5545484@typhoon.southeast.rr.com>,
nobody@nowhere.com wrote:
| Eric Gouriou wrote:
|
| [snip]
| > define generic \= (obj1, obj2) => (equal? :: <boolean>);
| > (here <object> is only used implicitly, but it is still used)
| >
| Oh, I was quite unclear about how generics could be defined then. I
| thought Obj1 and Obj2 could be required to be of the same (unknown)
| concrete type. You're indicating otherwise (that it is ok to compare
| <apple>'s and <orange>'s). If that is the case I apologize for asking the
| question, and withdraw my question about why the type system has the common
| root.
Is there a standard "clean" way of wrapping a Dylan object in a proxy
object? In Smalltalk, the standard way is to create a new subclass of
"nil" (instead of "Object"), which means it inherits no implementation
whatsoever. Then a single method "doesNotUnderstand:" is implemented in
that proxy class, which intercepts all messages sent to the proxy object
and sends them on to the wrapped object.
But with Dylan's multi-dispatch and a fixed root class of Object, this
trick doesn't work.
--
-- Tim Olson
Follow-Ups:
References: