Re: I do not understand method":"

2020-05-25 Thread ToddAndMargo via perl6-users
On 2020-05-25 14:00, Brad Gilbert wrote: In the following the 「:」 makes it so you don't need parenthesis You have created a monster! > my $s="a:c"; say $s.index: ":" 1 :-)

Re: I do not understand method":"

2020-05-25 Thread Brad Gilbert
A lambda is a function that doesn't have a name, or a location. my $var = *.raku(); say $var.( Date.today ); # Date.new(2020,5,25) The long way to write that would be: my $var = anon sub ( $_ ) { .raku() }; So this is passing in a function to sort, to calculate the value that

Re: I do not understand method":"

2020-05-25 Thread ToddAndMargo via perl6-users
On Mon, May 25, 2020 at 1:24 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Looking at the following: > my @things = .sort: *.Version; dd @things; for @things {say $_;} Array @things = ["a1b33", "a1", "a2rc2", "a2.3", "a5.1", "b1a23"] a

Re: I do not understand method":"

2020-05-25 Thread Brad Gilbert
In the following the 「:」 makes it so you don't need parenthesis (…).sort: … (…).sort(…) The reason there needs to be a space is so it isn't confused for an adverb. 「*.Version」 is a method call turned into a lambda. Basically it creates a lambda where the only thing it does is call a met