Dan Sugalski wrote:
At 4:57 PM +0200 10/19/02, Leopold Toetsch wrote:
[ Vtable union ]
Well... the problem is with references. Larry's declared that a reference must act identically to its referent if used in the right context. We could force an explicit deref, but I'd rather not. Treating the reference as if it were the array or hash itself makes things fit better conceptually, at least for me.
So the questions is, how does a reference look like - from a PMC POV? A PMC with an aggregate VTABLE and ->data pointing to the referents data? Or a PMC with a pointer to the aggregate in the ->data?
Your descriptions seems to include another PMC in tie_magic, while mine just passes the value PMC to tie_magic. tie_magic updates the value, then the normal scalar behaviour jumps in.So we would have e.g.: - Plain scalar: vtable->var.get_integer => return cache.int_val ->val.get_integer => return cache.int_valYep.- Tied scalar: vtable->var.get_integer => call tie magic (updating the value) => ->val.get_integer => return cache.int_val
Close. (Or the same if I'm misreading) Like:
-tied
vtable->var.get_integer => call tie magic to get value PMC
->tie_magic_returned_pmc.get_integer => reurn cache.int_val
(Assuming in both cases that the int value is cached and doesn't need to be string converted or anything)
leo
