AAron --

I think the point is that C<$x{$foo}> says "Hey C<$x>, y'know that 
unordered
mess of stuff you've been keeping track of? Get me the one tagged $foo,
woudja?" while C<$x[$n]> says "yo C<$x>! Grab me the C<$n>-th thingee
in line over there, hey!". And, nothing prevents you wanting to use a
number for a tag in the first instance (so type doesn't disambiguate). 
And,
nothing prevents you having a single object that allows both types of
abuse (like the tree stuff I posted about earlier). Thus, we retain two 
different
(but related) notations: one for unordered access, one for ordered access.
Any given object may support none, one or both.


Regards,

-- Gregor





Aaron Sherman <[EMAIL PROTECTED]>
01/30/2003 03:15 PM

 
        To:     Damian Conway <[EMAIL PROTECTED]>
        cc:     Perl6 Language List <[EMAIL PROTECTED]>
        Subject:        Re: arrays, hashes unified indexing syntax impact on future 
varia tion s 
on other collection types


On Thu, 2003-01-30 at 14:21, Damian Conway wrote:

> People, the whole argument that $a[key] should be a homonym for both
> array-like and hash-like look-ups is 

... a really bad argument to have, and I would not presume. When Perl
has tried to unify syntax in that way, it has ultimately failed (as you
note) to be coherent.

My question was, are these two different semantic operations, or are
they one operation with some type-sensitivity? Do curlies actually
resolve some fundamental ambiguity? I think we've demonstrated that they
don't, other than that ambiguity which exists already in the language,
outside of indexing operations.

What was the semantic tie between select and select? Even the tie
between the various gotos was pretty tenuous, and that caused problems.
This is a case where the indexing operator on one container class is
different from the indexing operator on another. Why? Because we had so
much spare syntax lying around? No. It was because a) AWK introduced the
idea and b) Perl1..5 had a "sigle denotes access, not type" model.

Those things are not terribly relevant to Perl 6, and as such, I'm not
sure why you feel that there's an imperative to use the Perl 5 notation.

Please enlighten me, Damian. I respect your deep understanding of this
language, and I'm willing to accept that you're intuitively grasping
something that I don't. All I see now is:

        <hash>name</hash><hashindex>value</hashindex>
        <array>name</array><arrayindex>value</arrayindex>

Which would seem to be easier written as:

        <index array=name>value</index> <!-- arrayindex -->
        <index hash=name>value</index> <!-- hashindex -->
        <index name=name>value</index> <!-- context-sensitive index -->

Perhaps casting it in non-Perl syntax will free us from the bonds of our
preconceptions....

-- 
Aaron Sherman <[EMAIL PROTECTED]>
This message (c) 2003 by Aaron Sherman,
and granted to the Public Domain in 2023.
Fight the DMCA and copyright extension!





Reply via email to