Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Moritz Lenz
Hi, On 09/26/2015 07:58 AM, Gabor Szabo wrote: > In the first two cases the hash was converted to Pairs before assigning > to the array. > Only the third case gave what I hoped for. How can I push a hash onto an > array as a single entity? > > > use v6; > > my %h = x => 6, y => 7; > say %h.perl

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Moritz Lenz
Hi, On 09/26/2015 06:47 AM, Gabor Szabo wrote: > Hi, > > I am really glad Rakudo finally came out. > I've installed in and tried to run the tests of Perl6::Maven. > > They quickly failed as I have been using 'require' on string > to check if all the module compile properly. > > The following co

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Gabor Szabo
On Sat, Sep 26, 2015 at 10:37 AM, Moritz Lenz wrote: > Hi, > > This works: > my @b; @b.push: $%h; > say @b.perl;# [{:a(1), :b(2)},] > > Cheers, > Moritz > Thanks. it worked. I kept throwing various sigils, bracket, and commas around in hope of getting this work without any success

Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Gabor Szabo
In the cloned repository of Bailador I ran perl6 examples/app.pl It launched the web server printing Entering the development dance floor: http://0.0.0.0:3000 [2015-09-26T10:04:46Z] Started HTTP server. but when I tried to access it with a browser it crashed with: [2015-09-26T10:04:49Z] GET /

Re: Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Gabor Szabo
And just to clarify launching this simple script (and then accessing it via a browser) would show the same problem: use lib 'lib'; use Bailador; get '/' => sub { "hello world" } baile; On Sat, Sep 26, 2015 at 1:16 PM, Gabor Szabo wrote: > In the cloned repository of Bailador I ran > > p

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Elizabeth Mattijsen
> On 26 Sep 2015, at 06:47, Gabor Szabo wrote: > I am really glad Rakudo finally came out. > I've installed in and tried to run the tests of Perl6::Maven. > > They quickly failed as I have been using 'require' on string > to check if all the module compile properly. > > The following code now fa

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Aristotle Pagaltzis
* Moritz Lenz [2015-09-26 09:40]: > A trailing comma helps: > > my %h = a => 1, b => 2; > my @a = %h, ; > say @a.perl;# [{:a(1), :b(2)},] I think I understand why, but wow, that’s not reasonable. Is there really no better way to avoid the flattening? Even Perl 5 is nicer in that situation… -

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Elizabeth Mattijsen
> On 26 Sep 2015, at 13:09, Aristotle Pagaltzis wrote: > * Moritz Lenz [2015-09-26 09:40]: >> A trailing comma helps: >> >> my %h = a => 1, b => 2; >> my @a = %h, ; >> say @a.perl;# [{:a(1), :b(2)},] > > I think I understand why, but wow, that’s not reasonable. Is there > really no better w

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Aristotle Pagaltzis
* Elizabeth Mattijsen [2015-09-26 13:20]: > The flattening will not be done if more than one argument is specified: > > $ 6 'my %h = a => 42, b => 666; my @a = %h,%h; dd @a' > Array @a = [{:a(42), :b(666)}, {:a(42), :b(666)}] > > > This is the same behaviour as with for: > > $ 6 'my %h = a => 42,

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Tobias Leich
Hi, that your example was working was an accident. It is either: require "path/to/Foo.pm"; - or - require ::("Foo"); Cheers, FROGGS Am 26.09.2015 um 06:47 schrieb Gabor Szabo: > Hi, > > I am really glad Rakudo finally came out. > I've installed in and tried to run the tests of Perl6::Maven. > >

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Tobias Leich
Itemization helps: m: my %h = x => 6, y => 7; my @a = $%h; say @a[0] rakudo-moar 0132b6: OUTPUT«x => 6, y => 7␤» m: my %h = x => 6, y => 7; my @a; @a.push: $%h; say @a[0] rakudo-moar 0132b6: OUTPUT«x => 6, y => 7␤» Am 26.09.2015 um 07:58 schrieb Gabor Szabo: > In the first two cases the hash was

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Moritz Lenz
On 09/26/2015 02:26 PM, Aristotle Pagaltzis wrote: > Now of course I must ask – is there an opposite also? I.e. when writing > a list, is there a way I can say “do flatten this item?” Yes, that's what type Slip is for: http://doc.perl6.org/type/Slip It's useful for returning more than one list

Re: Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Moritz Lenz
Hi, method .send was deprecated in favor of .print (for strings) and .write (with bufs/blobs) Maybe Bailador or one of its dependencies needs updating. Cheers, Moritz

Re: Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Tobias Leich
You need to upgrade HTTP::Easy, it already contains a fix. Am 26.09.2015 um 12:26 schrieb Gabor Szabo: > And just to clarify launching this simple script (and then accessing > it via a browser) would show the same problem: > > use lib 'lib'; > > use Bailador; > > get '/' => sub { > "hello worl

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Moritz Lenz
On 09/26/2015 01:07 PM, Elizabeth Mattijsen wrote: >> On 26 Sep 2015, at 06:47, Gabor Szabo wrote: >> I am really glad Rakudo finally came out. >> I've installed in and tried to run the tests of Perl6::Maven. >> >> They quickly failed as I have been using 'require' on string >> to check if all t

Re: Method 'send' not found for invocant of class 'IO::Socket::INET'

2015-09-26 Thread Gabor Szabo
Tobias thanks! I ran panda install HTTP::Easy and it installed the new version in /Users/gabor/rakudo-star-2015.09/install/share/perl6/site/lib/HTTP/Easy.pm6 but Rakudo is still loading the old one from /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/HTTP/Easy.pm6 and crashing. I can

Re: require on string stopped working in rakudo 2015.09

2015-09-26 Thread Gabor Szabo
On Sat, Sep 26, 2015 at 3:39 PM, Moritz Lenz wrote: > > >> I've fixed my script by switching to EVAL "use $module"; > >> but I wonder if this is a regression or a planned deprecation? > > > > I’m not sure yet. > > > > Could you please rakudobug it so that it doesn’t fall through the > cracks? Th

Announce: Rakudo Star Release 2015.09

2015-09-26 Thread Moritz Lenz
On behalf of the Rakudo and Perl 6 development teams, I'm excited to announce the September 2015 release of "Rakudo Star", a useful and usable distribution of Perl 6. The tarball for the September 2015 release is available from . This Rakudo Star release comes wi

Re: How to push a hash on an array without flattening it to Pairs?

2015-09-26 Thread Elizabeth Mattijsen
> On 26 Sep 2015, at 14:26, Aristotle Pagaltzis wrote: > * Elizabeth Mattijsen [2015-09-26 13:20]: >> There is: you just need to itemize the hash, e.g. by prefixing it with $ >> >> $ 6 'my %h = a => 42, b => 666; my @a = $%h; dd @a' >> Array @a = [{:a(42), :b(666)},] >> >> This is the one argum

signatures, multi and named arguments

2015-09-26 Thread mt1957
I was wondering if the long name of sub/method/submethod also includes the named arguments to differentiate between multi's. I had problems using multi on BUILD submethods which only accept named arguments. The dispather (also with other named methods) always takes the first method of the mult