List Info

Thread: Re: lexical aliases in 5.10?




Re: lexical aliases in 5.10?
user name
2007-05-29 13:33:15
On Tue, May 29, 2007 at 01:07:35PM -0500, David Nicol
wrote:
>On 5/29/07, Matthijs van Duin <xmathcpan.org> wrote:
>> >and read-only aliasing.
>>
>>That's a contradiction... aliasing causes two things
to be the same
>>thing, so one cannot be read-only while the other
isn't.  I get what you
>>mean by it, but it necessarily needs to have a level
of indirection,
>>which makes it something that's not aliasing.
>
>not necessarily. What if the RO handle and the RW handle
both have the
>same number of levels of indirection?

I wasn't talking about in general but in perl specifically. 
The SV 
contains the READONLY flag... aliasing is referring to the
same SV from 
different locations, which therefore necessarily are either
both RW, or 
both RO, since they're the same thing.

The only way to make an RO "alias" of an RW
container (without 
fundamentally changing how perl works), is by adding a level
of 
indirection:  a magic readonly SV that fetches its value
from the 
original SV.  But this isn't actually aliasing anymore.

-- 
Matthijs van Duin  --  May the Forth be with you!

Re: lexical aliases in 5.10?
user name
2007-05-29 13:45:05
On Tue, May 29, 2007 at 08:33:15PM +0200, Matthijs van Duin
wrote:

> The only way to make an RO "alias" of an RW
container (without 
> fundamentally changing how perl works), is by adding a
level of 
> indirection:  a magic readonly SV that fetches its
value from the 
> original SV.  But this isn't actually aliasing
anymore.

I guess it's more "binding". But the term isn't
actually important to me.
Specifically, Data::Bind was doing this indirection with
magic, but magic
isn't quite up to it for the corner cases. The plan for the
BIND type (better
name wanted) is to provide that extra level of indirection,
without needing
magic. (But, I believe, with a lot of core C code tweaks.)

I think we're on the same wavelength here, aren't we?

Nicholas Clark

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )