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

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: 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: 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

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

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

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: 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

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

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

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

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

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

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. > >

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

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

Re: Does Perl 6 use $a and $b in sorting?

2015-09-26 Thread Tobias Leich
sort accepts something callable with an arity of 2. Subroutines, blocks and pointies will do: say sort { $^a cmp $^b }, 5, 3, 2, 6, 4 OUTPUT«(2 3 4 5 6)␤» say sort { $^left cmp $^right }, 5, 3, 2, 6, 4 OUTPUT«(2 3 4 5 6)␤» say sort -> $a, $b { $a cmp $b }, 5, 3, 2, 6, 4 OUTPUT«(2 3 4 5 6)␤»

[perl #126198] [BUG] Defining a Proxy with methods instead of subs leads to surprising results in Rakudo

2015-09-26 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #126198] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=126198 > moritz++' gist inlined for your convenience: our $count = 0; class MagicVal { has

[perl #126200] LTA error message with misspelled labels

2015-09-26 Thread via RT
# New Ticket Created by Alex Jakimenko # Please include the string: [perl #126200] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=126200 > Code: outer: loop { loop { last owter; } }; Result: ===SORRY!=== Error while

[perl #126202] LTA results for trailing declarative docs

2015-09-26 Thread via RT
# New Ticket Created by Rob Hoelz # Please include the string: [perl #126202] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=126202 > In this example: class Foo { method bar { } #= baz }; say

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),

Does Perl 6 use $a and $b in sorting?

2015-09-26 Thread Parrot Raiser
Because of the the special significance of $a and $b in Perl 5's sort comparison, I always avoid using the names in examples, lest it set a booby-trap for later. I've noticed "a" and "b' being used in some P6 examples. Are they no longer significant, or are they just a poor choice of identifier?

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