> Alex why ghost is not ok? At that stage, it was more of a mental exercise.
> Because you want to have a portable proxy? If our implementation goes above a simple prototype, yes, it will have to work on VisualWorks. Alexandre > > Le 27/2/15 03:43, Alexandre Bergel a écrit : >> Hi! >> >> I have a near-to-be naive question. Maybe there is something obvious, but I >> cannot see it. Consider the following implementation of a proxy: >> >> -=-=-=-=-=-=-=-=-=-=-=-= >> Object subclass: #MyProxy >> instanceVariableNames: 'object'. >> >> MyProxy >> object: anObject >> object := anObject >> >> MyProxy >> doesNotUnderstand: aMessage >> ^ object perform: aMessage selector withArguments: aMessage arguments >> >> Object >> wrap >> self becomeForward: (MyProxy new object: self; yourself) >> -=-=-=-=-=-=-=-=-=-=-=-= >> >> The problem is with wrap. After the becomeForward:, MyProxy has itself in >> the object variable. Even self is apparently subject to the #become. >> >> It means that the following code loop indefinitely >> >> -=-=-=-=-=-=-=-=-=-=-=-= >> d := Dictionary new. >> d wrap. >> d add: #foo -> 10 >> -=-=-=-=-=-=-=-=-=-=-=-= >> >> I know there is Mariano’s library to write proxy. But I still wondering >> whether this could be done simply. >> Any idea how to simply create a proxy? >> >> Cheers, >> Alexandre >> > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
