At 05:58 PM 20/04/2001 -0400, Dan Sugalski wrote:
>At 06:49 PM 4/20/2001 -0300, Filipe Brandenburger wrote:
>>What would happen when $a = $b? Semantically, according to the tying and 
>>overloadings, the bignumber on $b should be written to the file $a is 
>>tied to, and when fetching the value of $a, it should return a bignumber, 
>>with all the overloaded operations that make the bignumber make sense.
>>
>>But if I have all in one vtable (both the tying and overloading methods), 
>>I wouldn't have how to set the vtable of $a according to the vtable of $b.
>
>What happens with the types of data during an assignment is a matter for 
>language design, not for internals. It can (and should) go either way 
>depending on how the parser spits out bytecode.
>
>Both ways are perfectly correct. The only question is which way it should 
>go. (Or, knowing Larry, which data type is tighter binding or something of 
>the sort)
>
>                                         Dan

Yes, both are probably possible, the question is that copying the tying 
behaviour of a variable to another one is not an assignment, but more like 
an aliasing, in my point of view. If two variables are tied to the same 
object, they essentially are the same.

Of course this operation is useful, that's why there were typeglobs in Perl 
5, but assignment is as important, if not more. And, as I see it, it's not 
possible to support assignment (keeping current correct overloading and 
tying behaviour), without keeping separate vtables for variables and values.

- Branden

Reply via email to