On Tue, May 29, 2007 at 01:07:35PM -0500, David Nicol
wrote:
>On 5/29/07, Matthijs van Duin <xmath cpan.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!
|