[Prev][Next][Index][Thread]
Proxy objects [was: Re: [Q]Why are all classes rooted by <object>]
On Sun, 29 Jul 2001, Tim Olson wrote:
> 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.
No need to apologize :-) But yes, you can compare different kinds of
fruit, and it's made much easier by them having a common superclass.
> Is there a standard "clean" way of wrapping a Dylan object in a proxy
> object? In Smalltalk, the standard way is to [use "doesNotUnderstand:]
This should probably be in a Dylan FAQ if it isn't already. It looks like
SmallTalk is the only "well-known" language which does sufficiently pure
message-passing OO to make this possible. In Dylan you have to do pretty
much the same as in C++/Java/etc.: write a wrapper class with a bunch of
"forwarding" methods. You could potentially make it easier to create
those methods by using macros, which would be especially useful if you're
creating many such classes, but it's still the same idea.
HTH,
Hugh
--
Version 3.1 GCS/IT d- s+:+>+: a- C++$ UL P+ L+(++) E W++$ N++ o K++ w(++) O?
M V? PS(+) PE Y+ PGP->++ t(+) 5+(++) X(+) R tv b++ DI+ D+ G e++ h- r>++ y+
(Removed reversed spam from my email address to reply)
Follow-Ups:
References: