Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Kamil Kułaga
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 => "

[perl6/specs] dbfaf5: minor fixes, updates

2014-06-13 Thread GitHub
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

[perl6/specs] f87f96: Add CURL lemma

2014-06-13 Thread GitHub
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:

[perl6/specs] 2b0409: fix twigil link

2014-06-13 Thread GitHub
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

[perl6/specs] a93489: add twigil

2014-06-13 Thread GitHub
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

Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Elizabeth Mattijsen
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')

Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread timo
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',

Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Kamil Kułaga
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({

Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Kamil Kułaga
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" =

Re: Jargon

2014-06-13 Thread Will Coleda
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

Jargon

2014-06-13 Thread Parrot Raiser
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

Re: Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Tobias Leich
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"

Rewrite using map? Trasformation array into hash of hash

2014-06-13 Thread Kamil Kułaga
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') );