On Mon Jun 15 06:12:13 2015, mt1...@gmail.com wrote:
> On 06/13/2015 04:06 PM, Elizabeth Mattijsen (via RT) wrote:
>
> Hi,
> May I react on this? Would it be easier to have perl6 throw an error
> when there is a named parameter in the call while it isn't defined in
> the method. Something like
rameter visually as well:
a => 42 # a Pair
:a(42) # a named parameter
I could also see going as far as making a named parameter an Enum, or a(nother)
subclass of it.
Liz
===
Begin forwarded message:
Date: 13 Jun 2015 04:25:43 GMT-6
From: mt1957
To: perl6 users
Subject
Hi Eirik,
I thought about this a bit longer. I've seen this before that typo's in
the named arguments can lead to things for which you think would happen
but they don't. proper testing should reveal this of course. But it
would also be nice that an error would be given by perl6 and we would
h
; a(nother) subclass of it.
>
>
> Liz
> ===
>> Begin forwarded message:
>>
>> Date: 13 Jun 2015 04:25:43 GMT-6
>> From: mt1957
>> To: perl6 users
>> Subject: problem pushing pairs onto an array of pairs
>>
>> l.s.
>>
making a named parameter an Enum, or a(nother)
subclass of it.
Liz
===
> Begin forwarded message:
>
> Date: 13 Jun 2015 04:25:43 GMT-6
> From: mt1957
> To: perl6 users
> Subject: problem pushing pairs onto an array of pairs
>
> l.s.
>
> Can
On Sat, Jun 13, 2015 at 12:25 PM, mt1957 wrote:
> Can't push/unshift onto an array of pairs!
>
> Below a repl session with pushes
>
> my @p = a => 1, b => 2;
>>
> a => 1 b => 2
>
>> @p.push(x=>1);
>>
> a => 1 b => 2
>
That's not pushing a pair – that's pushing nothing (no positionals) with
a
l.s.
Can't push/unshift onto an array of pairs!
Below a repl session with pushes
my @p = a => 1, b => 2;
a => 1 b => 2
@p.push(x=>1);
a => 1 b => 2
my Pair @p = a => 1, b => 2;
a => 1 b => 2
@p.push(x=>1);
a => 1 b => 2
my Array $p = [ a => 1, b => 2];
a => 1 b => 2
$p.push(x=>1);