On Wed, Apr 21, 2021 at 2:17 AM Joseph Brenner wrote:
> Ralph Mellor wrote:
>
> [ list of idioms ]
>
> > Learn to use the right idioms as soon as possible.
>
> Okay. Where's the list of preferred idioms?
The list you presented.
If you had or have chosen %h3 as the "right" idiom from
among the
Ralph Mellor wrote:
> Joseph Brenner wrote:
>
> > Before I get started here, a small point about defining hashes.
> > There are various ways that work:
> >
> >my %h1 = ( 'ha' => 1, 'ho' => 2, 'hum' => 3 );
> >my %h2 = ( ha => 1, ho => 2, hum => 3 );
> >my %h3 = ha => 1, ho =>
Btw, I had misunderstood ERN when, in 2018, I wrote the email
message I linked in the Note section of my previous email.
ERN is an intuitive sense that some movement you are initiating
is in some way a mistake. For example, quoting keys of a pair.
It's often unconscious, and, aiui, ignoring it ent
On Mon, Apr 19, 2021 at 4:03 PM Andy Bach wrote:
>
> Very impressive and complete explanation, thanks!
Thanks for that feedback, it's very helpful. I enjoy trying
to help, but it's hard to ensure I've conveyed a tone of
respect for whoever I'm replying to, at the same time
as trying to keep thing
ions "Did you mean to pass ...?"
From: Ralph Mellor
Sent: Sunday, April 18, 2021 11:59 PM
To: Joseph Brenner
Cc: perl6-users
Subject: Re: slurpy hash signatures
CAUTION - EXTERNAL:
On Sun, Apr 18, 2021 at 8:00 PM Joseph Brenner wrote:
>
> Before I get started here, a smal
On Sun, Apr 18, 2021 at 8:00 PM Joseph Brenner wrote:
>
> Before I get started here, a small point about defining hashes.
> There are various ways that work:
>
>my %h1 = ( 'ha' => 1, 'ho' => 2, 'hum' => 3 );
>my %h2 = ( ha => 1, ho => 2, hum => 3 );
>my %h3 = ha => 1, ho => 2, h
Bruce Gray points out that this is one of the known traps:
https://docs.raku.org/language/traps#Named_parameters
I gather there's some sort of special-casing going on where you might
think that named arguments are exactly the same a list of pairs, but
that's not precisely what's going on, and r
On Sun, Apr 18, 2021 at 3:00 PM Joseph Brenner wrote:
> Before I get started here, a small point about defining hashes.
> There are various ways that work:
>
> my %h1 = ( 'ha' => 1, 'ho' => 2, 'hum' => 3 );
> my %h2 = ( ha => 1, ho => 2, hum => 3 );
> my %h3 = ha => 1, ho =>
re's this:
multi method new(*%attrinit) {
And here in an article by Elizabeth Mattijsen I see:
https://opensource.com/article/18/9/signatures-perl-6
If you want to catch any (other) named arguments, you can use a
so-called "slurpy hash." Just like the slurpy array,
One thing also worth noting is that $1 is an alias to $/[1].
perl6
> my $1 = 2; say $1;
2
> my $1 = 2; say $/[1];
2
Also, $ is an alias to $/. This would make them rather difficult
to use in parameters, IMO.
--
John Harrison
On Wed, Aug 18, 2010 at 3:12 AM, Moritz Lenz wrote:
>
>
> Am 18.0
Am 18.08.2010 01:33, schrieb Darren Duncan:
David H. Adler wrote:
Hm. So how are valid parameter names defined? Identifiers in perl6 seem
to be composed of letters, digits and underscores (and hyphens and
apostrophes between letters).
That's correct.
Are parameter names defined differently
David H. Adler wrote:
Hm. So how are valid parameter names defined? Identifiers in perl6 seem
to be composed of letters, digits and underscores (and hyphens and
apostrophes between letters). Are parameter names defined differently?
You certainly seem to be able to declare a variable $1.
I belie
On Mon, Aug 16, 2010 at 03:49:52PM -0400, Will Coleda wrote:
> On Mon, Aug 16, 2010 at 3:36 PM, David H. Adler wrote:
> > On Mon, Aug 16, 2010 at 03:14:28PM -0400, Will Coleda wrote:
> >> On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler wrote:
> >> > Given the code:
> >> >
> >> > ? ? ? ?use v6;
>
On Mon, Aug 16, 2010 at 3:36 PM, David H. Adler wrote:
> On Mon, Aug 16, 2010 at 03:14:28PM -0400, Will Coleda wrote:
>> On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler wrote:
>> > Given the code:
>> >
>> > ? ? ? ?use v6;
>> >
>> > ? ? ? ?sub speakhash (*%hash) {
>> > ? ? ? ? ? ?say "%hash{}";
>>
On Mon, Aug 16, 2010 at 03:14:28PM -0400, Will Coleda wrote:
> On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler wrote:
> > Given the code:
> >
> > ? ? ? ?use v6;
> >
> > ? ? ? ?sub speakhash (*%hash) {
> > ? ? ? ? ? ?say "%hash{}";
> > ? ? ? ?}
> >
> > ? ? ? ?speakhash(1, 2, 3, 4, 5, 6);
> >
> > I
On Mon, Aug 16, 2010 at 3:03 PM, David H. Adler wrote:
> Given the code:
>
> use v6;
>
> sub speakhash (*%hash) {
> say "%hash{}";
> }
>
> speakhash(1, 2, 3, 4, 5, 6);
>
> I get the error:
>
> Too many positional parameters passed; got 6 but expected 0
Given the code:
use v6;
sub speakhash (*%hash) {
say "%hash{}";
}
speakhash(1, 2, 3, 4, 5, 6);
I get the error:
Too many positional parameters passed; got 6 but expected 0
in 'speakhash' at line 3:slurphash.p6
in main pr
17 matches
Mail list logo