Dear Timo,
I'm almost done with categorize. I stole similar example from rakudo
tests but I can't get rid off array on end. If I remove from map []
it stops working.
PS. I barely understand code I wrote anyway :)
$ perl6 ~/xx.pl
[A.new(a => "a", b => "22")]
Reference
A.new(a => "a", b => "
Branch: refs/heads/master
Home: https://github.com/perl6/specs
Commit: dbfaf58c566be8143705d900a860d6ea744bcedc
https://github.com/perl6/specs/commit/dbfaf58c566be8143705d900a860d6ea744bcedc
Author: Will "Coke" Coleda
Date: 2014-06-13 (Fri, 13 Jun 2014)
Changed paths:
M
Branch: refs/heads/master
Home: https://github.com/perl6/specs
Commit: f87f96be64a87a9117299861329ee9b3f68d22cd
https://github.com/perl6/specs/commit/f87f96be64a87a9117299861329ee9b3f68d22cd
Author: Elizabeth Mattijsen
Date: 2014-06-13 (Fri, 13 Jun 2014)
Changed paths:
Branch: refs/heads/master
Home: https://github.com/perl6/specs
Commit: 2b04097b884c1069188da01d050e5d4bf100d0be
https://github.com/perl6/specs/commit/2b04097b884c1069188da01d050e5d4bf100d0be
Author: Will "Coke" Coleda
Date: 2014-06-13 (Fri, 13 Jun 2014)
Changed paths:
M
Branch: refs/heads/master
Home: https://github.com/perl6/specs
Commit: a93489e612d483b84969b6376513610a1223b4a5
https://github.com/perl6/specs/commit/a93489e612d483b84969b6376513610a1223b4a5
Author: Will "Coke" Coleda
Date: 2014-06-13 (Fri, 13 Jun 2014)
Changed paths:
M
On 13 Jun 2014, at 12:36, Kamil Kułaga wrote:
> I was wondering whether following code can be rewritten using map/grep
> construct.
>
>
>class A {
> has $.a;
> has $.b;
> }
>
>
> my @array= (
> A.new(a=>'a', b=>'11'),
> A.new(a=>'a', b=>'22'),
> A.new(a=>'v', b=>'33')
On 06/13/2014 08:15 PM, Kamil Kułaga wrote:
> Ok got it. But solution is neither more readable nor faster (IMHO only
> -> I didn't benchmark it)
>
>
> class A { has $.a; has $.b };
> my @array = A.new(a=>'a', b=>'11'),
> A.new(a=>'a', b=>'22'),
> A.new(a=>'v', b=>'33'),
> A.new(a=>'w',
Ok got it. But solution is neither more readable nor faster (IMHO only
-> I didn't benchmark it)
class A { has $.a; has $.b };
my @array = A.new(a=>'a', b=>'11'),
A.new(a=>'a', b=>'22'),
A.new(a=>'v', b=>'33'),
A.new(a=>'w', b=>'44'),
A.new(a=>'v', b=>'55');
my %h = @array.map({
Hi Tobias,
Almost. At least at my rakudo creates list of hash of hash and loses
data while converting to hash:
("a" => "11" => A.new(a => "a", b => "11"), "a" => "22" => A.new(a =>
"a", b => "22"), "v" => "33" => A.new(a => "v", b => "33"), "w" =>
"44" => A.new(a => "w", b => "44"), "v" => "55" =
See:
https://github.com/perl6/specs/blob/master/S99-glossary.pod
which is nicely formatted here:
http://perlcabal.org/syn/S99.html
Regards.
On Fri, Jun 13, 2014 at 10:29 AM, Parrot Raiser <1parr...@gmail.com> wrote:
> As typically happens with any complex project, Perl 6 development has
> prod
As typically happens with any complex project, Perl 6 development has
produced a jargon that is almost impenetrable to outsiders. (It's
mostly on top of general Perl parlance, with some CS insertions.)
In order to explain 6 to the world in general, a Rosetta Stone is
going to be necessary. The fir
Hi, like that?
class A { has $.a; has $.b };
my @array = A.new(a=>'a', b=>'11'),
A.new(a=>'a', b=>'22'),
A.new(a=>'v', b=>'33'),
A.new(a=>'w', b=>'44'),
A.new(a=>'v', b=>'55');
say @array.map({ .a => .b => $_ })
OUTPUT«"a" => "11" => A.new(a => "a"
Hi,
I was wondering whether following code can be rewritten using map/grep
construct.
class A {
has $.a;
has $.b;
}
my @array= (
A.new(a=>'a', b=>'11'),
A.new(a=>'a', b=>'22'),
A.new(a=>'v', b=>'33'),
A.new(a=>'w', b=>'44'),
A.new(a=>'v', b=>'55')
);
13 matches
Mail list logo