[Omake] dynamic creation of variable names?
Erick Tryzelaar
erickt at dslextreme.com
Mon Jun 5 01:11:38 PDT 2006
Erick Tryzelaar wrote:
> Jason Hickey wrote:
>> Suppose we have some class/object hierarchy like this, where by the
>> arrows, I mean "extends".
>>
>> A
>> |---> B
>> |---> C
>> |---> D
>>
>> Say A.x is virtual. If I understand, the problem is that defining
>> C.x will also affect the value of A.x.
>>
>> I think what you want is for virtuals to propagate only down:
>> - redefining A.x propagates all the way down, so B.x, C.x, D.x all
>> change
>> - redefining B.x propagates to C.x and D.x, but not up to A.x
>>
>> This both makes sense and is weird at the same time. We get some
>> anomolies, like
>>
>> C.x = 1
>> A.x = 2
>> # Is C.x 1 or 2?
>>
>> The need seems clear to me, the solution isn't as clear to me...
>>
> My vote would be that C.x would equal 1. I see this functionality
> similar to how python does it's name lookup. Basically, you check the
> local object for a value. If it doesn't exist, check the parent, and
> up the list until we find the value or error out. So to extend your
> example some more:
>
> A.x = 1 # A.x=1 B.x=1 C.x=1 D.x=1
> B.x = 2 # A.x=1 B.x=2 C.x=2 D.x=2
> C.x = 3 # A.x=1 B.x=2 C.x=3 D.x=3
> D.x = 4 # A.x=1 B.x=2 C.x=3 D.x=4
>
>> BTW, in your previous email about lazy fields, you are right that
>> they are not doing the expected thing--I'll try to see what is going on.
> Cool, thanks.
Hi Jason,
It's been a couple months since we last discussed this issue with lazy
fields, virtuals, and objects. Has there been any progress in getting
this stuff fixed? I haven't noticed anything in the subversion checkins.
-e
More information about the Omake
mailing list