jerry gay wrote:
> On Fri, Nov 21, 2008 at 10:43, via RT Moritz Lenz
> <[EMAIL PROTECTED]> wrote:
>> # New Ticket Created by  Moritz Lenz
>> # Please include the string:  [perl #60732]
>> # in the subject line of all future correspondence about this issue.
>> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60732 >
>>
>>
>> From #perl6 today:
>>
>> 19:33 < moritz_> rakudo: my $x = [ 42 ]; say $x<0>
>> 19:33 < p6eval> rakudo 32984: OUTPUT[42␤]
>>
>> I don't think that should be allowed.
>>
> the real test is:
> 
> (8:52:47 PM) [particle]1: rakudo: my $x = [42]; say $x<0_but_true>;
> (8:52:49 PM) p6eval: rakudo 32998: OUTPUT[42␤]
> (8:53:38 PM) [particle]1: rakudo: my $x = [42]; say $x<true_but_0>;
> (8:53:40 PM) p6eval: rakudo 32998: OUTPUT[42␤]
> (8:53:50 PM) [particle]1: rakudo: my $x = [42]; say $x<XXX>;
> (8:53:52 PM) p6eval: rakudo 32998: OUTPUT[42␤]
> (8:54:37 PM) [particle]1: rakudo: my $x = ['a', 42]; say $x<XXX>;
> (8:54:39 PM) p6eval: rakudo 32998: OUTPUT[a␤]
> (8:58:41 PM) [particle]1: rakudo: my $x = ['a', 42]; say $x<1.4>;
> (8:58:44 PM) p6eval: rakudo 32998: OUTPUT[42␤]
> (8:58:48 PM) [particle]1: rakudo: my $x = ['a', 42]; say $x<0.4>;
> (8:58:50 PM) p6eval: rakudo 32998: OUTPUT[a␤]
> 
> so, the index is coerced to an integer. is that really wrong?
> ~jerry

IMHO yes, because Perl explicitly distinguishes between arrays and
hashes (and it's one of the things we never regretted, I think ;-). Any
intermixing between the two would only lead to confusion, especially if
somebody writes a class whose objects are both hashe and array.

But that's just my two cents, CC'ing p6l for clarification.

Moritz

Reply via email to