»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:01 BenGoldberg joined
Zoffix I'm gonna lose it. 00:04
This was annoying but I fixed it: (1) I used `leftovers` in the grammar, but `left-overs` in Actions. (2) I had $str ~= $left-overs; when it should've been $str = $left-overs ~ $str; 00:07
Time to boot up Assassin's Creed and murder a few hundred people :(
00:07 raiph joined 00:09 IRCBot1465085383 joined 00:11 pierre_ left 00:14 Zoffix left, Zoffix joined, spider-mario left
raiph .ask masak re "when (*, * < 0) { ... }"; does "when (*; * < 0) { ... }" work for your use case? 00:20
yoleaux raiph: I'll pass your message to masak.
TimToady .ask masak or were you expecting it to do (**, * < 0) instead? 00:25
yoleaux TimToady: I'll pass your message to masak.
TimToady m: my @a = 1,-2; say "Good" when (*, * < 0) given @a; 00:27
camelia rakudo-moar 986891: OUTPUT«Good␤»
00:52 silug left 00:59 IRCBot1465085383 left, IRCBot1465088396 joined 01:01 wamba left 01:05 silug joined, IRCBot1465088396 left 01:15 silug left 01:20 jack_rabbit joined 01:23 kalkin- left, kalkin-_ joined 01:26 jcallen left, Zoffix__ joined, finanalyst joined 01:27 jcallen joined, Zoffix__ left
gfldex m: sub returns-different-things () { ((10,"ten"), 10 ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } } 01:30
camelia rakudo-moar 986891: OUTPUT«This should never happen␤»
gfldex m: sub returns-different-things () { ((10,"ten"), 10 ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«It returned a list.␤»
01:30 pierre_ joined
gfldex why is the default block executed? 01:30
01:32 pierre_ left
Zoffix m: sub returns-different-things () { ((10,"ten"), (10), ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } } 01:33
camelia rakudo-moar 986891: OUTPUT«This should never happen␤»
01:34 silug joined
Zoffix gfldex, how come it's an :(Int) and not just Int? 01:34
The default is executed, because 10 is not a list with an Int in it
m: sub returns-different-things () { ((10,"ten"), 10.list ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«It returned a list.␤»
gfldex i c 01:35
Zoffix m: sub returns-different-things () { ((10,"ten"), 10.list ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«returned a single Int␤»
Zoffix m: sub returns-different-things () { ((10,"ten"), 10 ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when Int { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«It returned a list.␤»
Zoffix m: sub returns-different-things () { ((10,"ten"), 10 ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when Int { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«It returned a list.␤»
Zoffix m: sub returns-different-things () { ((10,"ten"), 10 ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when Int { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«It returned a list.␤»
Zoffix well.. .it'll work when it's a 10 :)
gfldex m: say 10 ~~ :(Int);
camelia rakudo-moar 986891: OUTPUT«False␤»
gfldex m: say (10) ~~ :(Int);
camelia rakudo-moar 986891: OUTPUT«False␤»
gfldex m: say \(10) ~~ :(Int);
camelia rakudo-moar 986891: OUTPUT«True␤»
gfldex m: say (10).list ~~ :(Int); 01:36
camelia rakudo-moar 986891: OUTPUT«True␤»
Zoffix m: say ((10),) ~~ :(Int);
camelia rakudo-moar 986891: OUTPUT«True␤»
gfldex m: sub returns-different-things () { \(((10,"ten"), 10 ).pick) }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } }
camelia rakudo-moar 986891: OUTPUT«This should never happen␤»
gfldex m: sub returns-different-things () { ((10,"ten"), \(10) ).pick }; given returns-different-things() { when :(Int, Str) { say 'It returned a list.' }; when :(Int) { say 'returned a single Int' }; default { say 'This should never happen' } } 01:37
camelia rakudo-moar 986891: OUTPUT«returned a single Int␤»
gfldex m: say 10 ~~ :(Int); # I'm not sure if I should agree with this. 01:38
camelia rakudo-moar 986891: OUTPUT«False␤»
Zoffix Why are you using :() ? 01:39
gfldex because I want to test against a signature
Zoffix m: say sub (Int) {}.signature ~~ :(Int) 01:40
camelia rakudo-moar 986891: OUTPUT«True␤»
Zoffix m: :(Int).WHAT.say 01:41
camelia rakudo-moar 986891: OUTPUT«(Signature)␤»
Zoffix m: say 10.Capture ~~ :(Int); 01:42
camelia rakudo-moar 986891: OUTPUT«False␤»
gfldex you can use signature literals in a when test. That is very helpful if a routine returns different types. It would be nice if it would be neatly regular by allowing a test against a single value. 01:43
Zoffix m: say 10.Capture; say [10].Capture
camelia rakudo-moar 986891: OUTPUT«\()␤\(10)␤»
Zoffix I wonder if 10.Capture is returning the right thing here...
gfldex i thínk it doesn't 01:44
the birds are getting noisy. I may rakudobug tomorrow.
Zoffix
.oO( birds? )
gfldex there is an outside world. It's where this "sun" thing is. 01:45
it also got birds
good night :)
Zoffix m: use MONKEY-TYPING; augment class Int { method Capture { \(self) } }; say 10.Capture
camelia rakudo-moar 986891: OUTPUT«\(10)␤»
Zoffix m: use MONKEY-TYPING; augment class Int { method Capture { \(self) } }; say 10 ~~ :(Int);
camelia rakudo-moar 986891: OUTPUT«False␤»
01:46 ilbot3 left
Zoffix Sun? But I thought they were acquired by Oracle! 01:47
01:47 ilbot3 joined
BenGoldberg m: sub returns-different-things () { ((10,"ten"), \(10) ).pick }; given returns-different-things() { when :(Int $x, Str $y) { say "[two things: $x, $y]" }; when :(Int $z) { say "One thing: $z" }; default { say 'This should never happen' } } 01:49
camelia rakudo-moar 986891: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ipbB5pg6ql␤Variable '$x' is not declared␤at /tmp/ipbB5pg6ql:1␤------> 3n :(Int $x, Str $y) { say "[two things: 7⏏5$x, $y]" }; when :(Int $z) { say "One th␤»
BenGoldberg m: sub returns-different-things () { ((10,"ten"), \(10) ).pick }; given returns-different-things() { when [Int $x, Str $y] { say "[two things: $x, $y]" }; when [Int $z] { say "One thing: $z" }; default { say 'This should never happen' } } 01:50
camelia rakudo-moar 986891: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QqctzNUBNy␤Two terms in a row␤at /tmp/QqctzNUBNy:1␤------> 3n returns-different-things() { when [Int7⏏5 $x, Str $y] { say "[two things: $x, $y]␤ expecting any of:␤ infix␤ infi…»
BenGoldberg m: my multi sub foo(Int $x) { "[one $x]" }; my multi sub foo(Int $y, Str $z) { "[two $y, $x]" }; say foo( ((10,"ten"), \(10) ).pick ); 01:52
camelia rakudo-moar 986891: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nOS30VmBhA␤Variable '$x' is not declared␤at /tmp/nOS30VmBhA:1␤------> 3lti sub foo(Int $y, Str $z) { "[two $y, 7⏏5$x]" }; say foo( ((10,"ten"), \(10) ).pi␤»
BenGoldberg m: my multi sub foo(Int $x) { "[one $x]" }; my multi sub foo(Int $y, Str $z) { "[two $y, $z]" }; say foo( ((10,"ten"), \(10) ).pick );
camelia rakudo-moar 986891: OUTPUT«Cannot call foo(Capture); none of these signatures match:␤ (Int $x)␤ (Int $y, Str $z)␤ in block <unit> at /tmp/iZgdzignp0 line 1␤␤»
BenGoldberg m: my multi sub foo(Int $x) { "[one $x]" }; my multi sub foo(Int $y, Str $z) { "[two $y, $z]" }; say foo( ((10,"ten"), (10) ).pick );
camelia rakudo-moar 986891: OUTPUT«[one 10]␤»
BenGoldberg m: my multi sub foo(Capture $x) { "[one $x]" }; my multi sub foo(Int $y, Str $z) { "[two $y, $z]" }; say foo( ((10,"ten"), \(10) ).pick ); 01:53
camelia rakudo-moar 986891: OUTPUT«Cannot call foo(List); none of these signatures match:␤ (Capture $x)␤ (Int $y, Str $z)␤ in block <unit> at /tmp/ThOHkeK6Ap line 1␤␤»
BenGoldberg m: my multi sub foo(Capture $x) { "[one $x]" }; my multi sub foo(List @y) { "[some @y]" }; say foo( ((10,"ten"), \(10) ).pick );
camelia rakudo-moar 986891: OUTPUT«[one 10]␤»
BenGoldberg gfldex, I suspect that using multiple dispatch (with 'my' subs) will be easier to write (and easier to read later!) than given/when. 01:56
02:06 kid51 left, mr-foobar left 02:07 mr-foobar joined 02:13 kid51 joined, jeek left, jeek joined 02:26 yqt left 02:33 pierre_ joined 02:37 pierre_ left 02:38 noganex_ joined 02:41 noganex left 02:52 kid51 left 03:02 labster left 03:25 ssotka joined 03:34 pierre_ joined 03:39 nowan left, mst left, nowan joined 03:40 pierre_ left 03:45 mst joined
Zoffix 3m: my @f = foo=> 'bar', meow => 'moo'; for @f -> ($name, $s) { say "[$name]->[$s]" } 03:45
m: my @f = foo=> 'bar', meow => 'moo'; for @f -> ($name, $s) { say "[$name]->[$s]" }
camelia rakudo-moar 986891: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in block <unit> at /tmp/3pIYvsc9L4 line 1␤␤»
Zoffix Any way to make this work? I want $name to have the .key and $s the .value of each Pair in @f 03:46
03:46 labster joined
ugexe m: my @f = foo => 'bar', meow => 'moo'; for @f.hash.kv -> $name, $s { say "[$name]->[$s]" } 03:48
camelia rakudo-moar 986891: OUTPUT«[foo]->[bar]␤[meow]->[moo]␤»
ugexe or %@f.kv if you prefer that 03:49
Zoffix ugexe++ Thanks
03:51 pierre_ joined 03:52 pierre_ left, pierre_ joined
Zoffix How come this line doesn't await anything and the script seems to just exit? github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L54 The `say` on the previous line produces: (Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Planned)) 04:03
And if I await on this line, then it awaits :/ github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L23
Ah, I need to Slip it into await. Laaame.. I expected it to complain 04:05
04:05 pierre_ left 04:07 pierre_ joined
Zoffix Oh.. Doesn't work with two promises :/ 04:09
04:12 khw left
ugexe await Promise.allof(...) 04:20
04:22 Cabanossi left 04:26 Cabanossi joined 04:32 mr-foobar left 04:33 mr-foobar joined 04:49 mr-foobar left, mr-foobar joined 04:53 _nadim joined 04:56 nadim left 05:01 pierre_ left, pierre_ joined 05:11 pierre_ left 05:15 pierre_ joined 05:25 pierre_ left, slobo left 05:47 rindolf joined 05:51 AlexDaniel left 05:57 ssotka left 05:58 araujo_ left 06:03 pierre_ joined 06:04 BenGoldberg left 06:06 BenGoldberg joined 06:16 wamba joined 06:18 pierre_ left, buharin joined 06:24 pierre_ joined 06:29 kaare_ joined 06:37 kaare_ left 06:38 kaare_ joined 06:41 bjz joined 06:42 BenGoldberg left, bjz_ left 06:52 kaare_ left 06:53 kaare_ joined 07:02 rurban joined 07:05 pierre_ left 07:07 pierre_ joined 07:09 pierre_ left 07:10 pierre_ joined 07:12 pierre_ left 07:13 wamba left 07:15 darutoko joined 07:16 buharin left 07:17 wamba joined 07:21 pierre_ joined 07:22 rurban1 joined 07:23 rurban left 07:28 bjz_ joined 07:29 bjz left 07:30 RabidGravy joined 07:39 gnull joined
gfldex m: dd 10.list, 10.Capture, 0.5.list, 0.5.Capture; 07:43
camelia rakudo-moar 986891: OUTPUT«(10,)␤\()␤(0.5,)␤\(:denominator(2), :numerator(1))␤»
gfldex m: .WHAT.say for 10.List, 10.Capture; 07:44
camelia rakudo-moar 986891: OUTPUT«(List)␤(Capture)␤»
gfldex m: .WHAT.say for 10.Capture;
camelia ( no output )
RabidGravy boom
07:44 labster left 07:45 gnull left, user9 joined
teatime welp that is odd 07:45
gfldex m: .&dd for 10.Capture; 07:46
camelia ( no output )
gfldex m: .&dd for 10.Capture, 10.List;
camelia rakudo-moar 986891: OUTPUT«\()␤(10,)␤»
teatime I guess the Capture is positional/iterable, and empty? 07:47
gfldex Int.Capture is empty, while many other single value types are not 07:48
07:52 gnull joined
gfldex rakudobuged as #128321 07:57
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128321
sjn m: say π.Capture 08:17
camelia rakudo-moar 986891: OUTPUT«\()␤»
gfldex m: dd "Pie".Capture 08:18
camelia rakudo-moar 986891: OUTPUT«\()␤»
08:24 sortiz joined
sortiz \o #perl6 08:25
yoleaux 4 Jun 2016 21:04Z <slobo> sortiz: I'm able to correctly access the elements of a list, but then I get random crashes, eg: moar(23669,0x7fff75b7b000) malloc: *** error for object 0x7fe448b70138: incorrect checksum for freed object - object was probably modified after being freed.
teatime morning sortiz
sortiz m: dd Blob.new(1).Capture 08:28
camelia rakudo-moar 986891: OUTPUT«\()␤»
gfldex github.com/rakudo/rakudo/blob/nom/...Mu.pm#L473 08:30
08:30 azawawi joined
azawawi hi 08:30
gfldex as I understand it, the generic .Capture will only work on objects that have attributes
azawawi RabidGravy: ping 08:31
gfldex m: 10.^attribures.say
RabidGravy Harr!
camelia rakudo-moar 986891: OUTPUT«Method 'attribures' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at /tmp/IGWtTepI_z line 1␤␤»
gfldex m: 10.^attributes.say
camelia rakudo-moar 986891: OUTPUT«Method 'gist' not found for invocant of class 'BOOTSTRAPATTR'␤ in block <unit> at /tmp/LW1xPuIC5g line 1␤␤»
gfldex m: dd 10.^attributes
camelia rakudo-moar 986891: OUTPUT«Method 'perl' not found for invocant of class 'BOOTSTRAPATTR'␤ in block <unit> at /tmp/2MOFnd6IPq line 1␤␤»
gfldex m: dd 10.^attributes.WHAT 08:32
camelia rakudo-moar 986891: OUTPUT«Cannot look up attributes in a type object␤ in block <unit> at /tmp/418q2vcdCW line 1␤␤»
sortiz gfldex, so, I say for object with "structure" :-)
azawawi RabidGravy: hehe.. finally i have a macbook pro to play with from a collegue... installing rakudo :)
RabidGravy oh dear
08:33 firstdayonthejob joined
azawawi RabidGravy: installing xcode.... lame 3.8 GB :( 08:33
08:36 bjz joined 08:38 bjz_ left
sortiz .tell slobo With NC, "random crashes" normally means bad assumptions about memory ownership. 08:38
yoleaux sortiz: I'll pass your message to slobo.
08:42 jack_rabbit left
sortiz m: class Foo { has $.foo }; class Bar { has $!bar }; dd Foo.new.Capture, Bar.new.Capture; # moreover, attributes *with* accessors 08:44
camelia rakudo-moar 986891: OUTPUT«\(:foo(Any))␤\()␤»
08:45 jack_rabbit joined 09:06 azawawi left
llfourn is there any method which when called on an undefined will return an Empty but when called on somethiing defined will create a Slip from the value(s)? 09:16
m: .say for .<foo>' # so this doesn't do any iterations
camelia rakudo-moar 986891: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GgzIkuw9Kz␤Two terms in a row␤at /tmp/GgzIkuw9Kz:1␤------> 3.say for .<foo>7⏏5' # so this doesn't do any iterations␤ expecting any of:␤ infix␤ infix stopper␤»
llfourn m: .say for .<foo> # so this doesn't do any iterations
camelia rakudo-moar 986891: OUTPUT«(Any)␤»
llfourn m: $_ = { foo => <bar baz> }; .say for .<foo> # but this still works 09:17
camelia rakudo-moar 986891: OUTPUT«(bar baz)␤»
llfourn m: $_ = { foo => <bar baz> }; .say for |.<foo> # rather 09:18
camelia rakudo-moar 986891: OUTPUT«bar␤baz␤»
llfourn m: .say for |.<foo>
camelia rakudo-moar 986891: OUTPUT«(Any)␤»
09:19 girafe left
llfourn m: .say for |(.<foo> // Empty) # my best answer 09:19
camelia ( no output )
09:19 brrt joined
lizmat m: my %h = a => |(); dd %h; .say for %h<a> # llfourn this maybe? 09:20
camelia rakudo-moar 986891: OUTPUT«Hash %h = {:a(slip$())}␤»
llfourn lizmat: my issue is the case where 'a' doesn't exist at all 09:21
m: my %h; .say for %h<a> # how do I stop Any being there
camelia rakudo-moar 986891: OUTPUT«(Any)␤»
RabidGravy is it possible to decompose a Pair in a signature, something like "foo(Pair $ ( $key, $value))" ? 09:22
llfourn RabidGravy: I think it is 09:23
RabidGravy the above doesn't work BTW
llfourn I'm sure I've seen it >< 09:24
sortiz m: sub foo( ( :$key, :$value ) ) { say $key,$value }; foo( 'a'=>10 ); 09:27
camelia rakudo-moar 986891: OUTPUT«a10␤»
llfourn ahhhh yes
sortiz++
09:27 user9 left
RabidGravy sortiz++, yeah I thought I'd seen it too :) 09:27
llfourn they have to be named $key, $value is the trick 09:28
RabidGravy my specific thing is that I want a multi on either the key or value of the pair
llfourn what does that mean? 09:29
lizmat m: my %h is default( slip() ); dd %h; .say for %h<a> # llfourn
camelia rakudo-moar 986891: OUTPUT«Hash %h = {}␤»
RabidGravy something like
llfourn lizmat: that is awesome!
lizmat: though in my specific case I'm using a match object in a grammar :S 09:30
the current line is: { $*CURPAD.declare($_) for |($<paramlist>.ast // Empty) }
wondering if there's something nicer than that
RabidGravy m: multi sub foo(Pair $p ( :$key, Int :$value ) ) { say "Int $key $value"; }; multi sub foo(Pair $p ( :$key, Str :$value ) ) { say "Str $key $value"; }; foo("foo" => "bar"); foo("foo" => 42); 09:31
camelia rakudo-moar 986891: OUTPUT«Str foo bar␤Int foo 42␤»
RabidGravy but in reality something more complex 09:32
llfourn ah cool. signatures++
sortiz m: sub foo( ( :key($k), :value($v) ) ) { say $k,$v }; foo( 'a'=>10 ); # BTW
camelia rakudo-moar 986891: OUTPUT«a10␤»
RabidGravy sure :) 09:33
09:34 user9 joined 09:40 user9 left 09:41 Ven joined 09:44 user9 joined 09:51 user9 left 09:52 brrt left 09:53 rurban joined, Ven_ joined 09:54 Ven left 09:55 spider-mario joined 09:57 rurban1 left 09:58 Emeric joined
sortiz llfourn, with $<paramlist> { $*CURPAD.declares($_) for .ast } # nicer? 09:59
llfourn sortiz: yeah I think that's better actually :) 10:02
I had a problem with 'with' statement sometimes disappearing when used inside grammars 10:03
but I think that was the statement modifier form
(I think the optimizer mistakenly removed them) 10:04
sortiz I hasn't played much with grammars, so never seen that. 10:06
But I'm in love with 'with' :) 10:08
llfourn yes with is very handy
because even if you have an with { } else { }, $_ will be set in the else too 10:09
so with %h<key> { do_something($_) } else { $_ = "foo" } works
sortiz Yep, and $_ is a bind 10:10
llfourn yup
10:12 colomon joined 10:16 buharin joined 10:18 TEttinger left 10:20 kaare_ left 10:22 rurban left 10:26 colomon left, Ven joined 10:27 Ven_ left 10:32 labster joined 10:37 Levine joined 10:38 Levine left 10:40 Ven_ joined 10:42 Ven left 10:45 araujo joined, araujo left, araujo joined, araujo left 10:54 ilogger2 joined, ChanServ sets mode: +v ilogger2 10:55 M-Illandan joined 10:56 Bucciarati joined, kmwallio joined, salv0 joined 10:58 cosarara joined 10:59 jusafing joined, sunnavy_ joined, jferrero_ joined 11:00 brrt joined, Peter_R joined, felher joined 11:01 silug joined, k-man joined 11:02 kid51 joined, domm joined, teatime joined 11:03 parisba joined 11:04 parisba is now known as Guest690 11:11 BinGOs joined 11:13 pierre_ joined 11:14 pierre_ left, araujo joined 11:35 |meta joined 11:40 |meta is now known as |sir 11:43 buharin joined 11:53 colomon joined 11:58 colomon left 11:59 brrt left 12:06 Peter_R left, Peter_R joined 12:09 rurban joined 12:11 buharin left, Ven joined 12:16 Deep_Thought joined 12:17 rurban1 joined 12:18 rurban2 joined, rurban2 left 12:20 rurban left 12:21 rurban1 left 12:25 Ven left 12:27 colomon joined 12:28 Ven joined 12:32 buharin joined 12:35 FROGGS joined
RabidGravy boom 12:35
FROGGS o/
Zoffix m: await start { sleep 3; say "32" }, start { sleep 2; say 42 }; 12:36
camelia rakudo-moar 85682a: OUTPUT«42␤32␤»
Zoffix ugexe, but how come allof is not needed here ^ ?
m: my %s; %s<one><p> = start { sleep 3; say "32" }; %s<two><p> = start { sleep 2; say 42 }; await %s.values».<p> 12:38
camelia rakudo-moar 85682a: OUTPUT«42␤32␤»
Zoffix This is exactly like my thing :/
timotimo await already takes a list of promises and such, doesn't it? 12:39
or is the semantics "anyof" by default?
because i thought it's "allof"
Zoffix If it were anyof, only one value would print above
timotimo yeah
12:40 Ven left, colomon left
Zoffix But here it waits for nothing at all. Program exits: github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L54 12:41
timotimo huh :o 12:42
12:43 bjz_ joined
Zoffix (works with .allof) 12:43
FSVO 12:44
timotimo oh
could be list vs argument list?
try with a | ?
Zoffix That fixes the issue... but only when there's just one Promise. 12:45
timotimo huh
Zoffix But there's also some other error in the code. I can't get the error to show up though. My CATCH { warn .backtrace } print backtraces but no error :S
12:45 Ven joined
Zoffix bloody annoying 12:45
timotimo yeah, i think the unhandled exception handler we have by default isn't working correctly 12:46
pochi m: class Point { has $.x; has $.y }; "(12,23) (34,45)".split(" ").map( { m/\((\d+)","(\d+)\)/ } ).map( { Point.new( x => $/[0].Int, y => $/[1].Int ) } ) 12:49
camelia ( no output )
pochi is there a more perl6-ish way to write the above? something more succinct?
timotimo yeah, you can .comb to get the numbers, for instance
pochi looks up comb 12:50
timotimo and .comb will give you strings instead of match objects by default, which will get rid of the $/ dance
pochi nice
tries it out
timotimo m: class Point { has $.x; has $.y }; "(12,23) (34,45)".comb(/ \d+ /).map({ Point.new( x => $^x, y => $^y ) }).say;
camelia rakudo-moar 85682a: OUTPUT«(Point.new(x => "12", y => "23") Point.new(x => "34", y => "45"))␤»
timotimo ^- implicit signature for the win 12:51
pochi insane
:-)
FROGGS .tell sortiz I you wanna tackle something in XML::LibXML, pick either a still failing test file or grab a new test file from t/to-be-ported and move it to t
yoleaux FROGGS: I'll pass your message to sortiz.
12:51 colomon joined
Zoffix m: class Point { has $.x; has $.y }; "(12,23) (34,45)".comb(/\d+/).map( { Point.new( x => +$^a, y => +$^b ) } ).say 12:51
camelia rakudo-moar 85682a: OUTPUT«(Point.new(x => 12, y => 23) Point.new(x => 34, y => 45))␤»
Zoffix is late as usual
12:51 Actualeyes joined
timotimo ah, yes, it wants to have + in there 12:51
otherwise it'll put Str into your coordinates 12:52
pochi got it!
12:54 Zoffix joined 12:56 Zero_Dogg joined, Ven left
jnthn m: class Point { has $.x; has $.y }; "(12,23) (34,45)".comb(/ \d+ /).map({ Point.new( :$^x, :$^y ) }).say; # another neat trick :) 12:57
camelia rakudo-moar 85682a: OUTPUT«(Point.new(x => "12", y => "23") Point.new(x => "34", y => "45"))␤»
timotimo indeed it is 12:58
pochi but you'd still need the + infront 13:00
timotimo right, or have the type in your class be Int()
jnthn or .map(*.Int) first, but yeah :)
timotimo m: class Point { has Int() $.x; has Int() $.y }; "(12,23) (34,45)".comb(/ \d+ /).map({ Point.new( :$^x, :$^y )}).say;
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5===␤Coercion Int(Any) is insufficiently type-like to qualify a variable␤at /tmp/w47gJ3AYB5:1␤------> 3class Point { has Int() $.x7⏏5; has Int() $.y }; "(12,23) (34,45)".com␤Coercion Int(Any) is insufficiently type-like to quali…»
timotimo oh :\
we could support that, i think 13:01
but only if access to $! remains un-coercion-ish
jnthn Yeah, that's the tricky thing :)
13:01 Actualeyes left
timotimo if the users would accept that we do it like that, it's doable 13:01
otherwise it's not quite as doable ...
pochi shouldn't it know that comb returns Str? 13:02
timotimo "it"?
13:02 Actualeyes joined
pochi the compiler :-) 13:03
13:03 brrt joined
timotimo well, comb is a method, so the object is responsible for deciding what it'll do 13:03
but in this case the string is a literal, so the compiler knows what exact type it'll be
13:03 araujo_ joined
timotimo but what would the compiler do when it sees that comb returns the list of strings? 13:03
13:03 Actualeyes left
pochi the it woulod be coercion Int(Str) instead of Int(Any)? 13:04
13:04 Actualeyes joined 13:05 araujo_ left
pochi *then *would 13:05
timotimo the problem is we can't have the attribute defined to have a coercion type
13:05 araujo_ joined, Ven joined 13:06 Actualeyes left
Zoffix Segmentation fault 13:06
Weeee...
13:06 araujo left, Actualeyes joined
timotimo nice 13:06
13:06 sammers joined
Zoffix I think I may give up programming for today and play video games. This is way annoying. 13:06
13:07 araujo_ left
brrt Zoffix: where have you a segv 13:07
timotimo thing is, assigning to a private attribute isn't actually an assignment, it's a bind that'll also check types, but it won't run code to do a coercion
brrt also, what video games?
13:08 araujo_ joined
brrt myself i'm keen to finally start playing the wonderful 101 13:08
timotimo oooh
that's a fun one
i haven't played it, but i've seen it played
sammers is it possible to use something like this: `use Foo; my $foo = Foo.new("some stuff here") for a `unit module Foo`, without using `unit class Foo`?
pochi timotimo: sorry, it's way over my head :-)
Zoffix brrt, I was commenting out lines inside this loop and it segfaulted when I uncommented the CATCH, but when I ran it again, it didn't happen: github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L46
timotimo no worries :) 13:09
Zoffix brrt, and I'm playing the Assassin's Creed series ATM
brrt ah, IO::Socket::Async
never done one of those
13:09 araujo_ left 13:10 araujo_ joined
jnthn sammers: No; a module isn't something you can make an instance of, it's just a bunch of subs 13:11
13:11 Actualeyes left, araujo_ left 13:12 araujo_ joined
pochi sammers: you can have a Foo class in your Foo module 13:12
13:13 Actualeyes joined
sammers jnthn: ok, thanks, that explains a lot. so `unit module Foo` and `unit class Foo` are the only ways to create a module? 13:14
13:14 araujo_ left 13:15 pierre_ joined, araujo_ joined, Actualeyes left, Actualeyes joined 13:17 araujo_ left, araujo_ joined 13:19 araujo_ left, araujo_ joined 13:21 pierre_ left, araujo_ left
Zoffix Found my issue. 13:21
m: sub ($x) {}(1,2)
camelia rakudo-moar 85682a: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in sub at /tmp/ztHlUZTr6k line 1␤ in block <unit> at /tmp/ztHlUZTr6k line 1␤␤»
13:21 araujo_ joined
Zoffix The error wasn't showing up ~_~ 13:21
13:22 Actualeyes left
timotimo right, in Audio::PortMidi there was also errors inside a started thing that weren't showing up 13:22
that sent me on a wild goosechase, because i thought nativecall was at fault
13:23 Actualeyes joined, araujo_ left, araujo_ joined 13:24 wamba joined
Zoffix m: await start { class {method f ($x){}}.new.f(1, 2) } 13:24
camelia rakudo-moar 85682a: OUTPUT«Too many positionals passed; expected 2 arguments but got 3␤ in block <unit> at /tmp/6uoOlDbxee line 1␤␤»
Zoffix ¯\_(ツ)_/¯
timotimo maybe because you're awaiting it? 13:25
13:25 araujo_ left
timotimo so it doesn't have to go through the unhandled exception handler 13:25
13:26 araujo_ joined
Zoffix I'm awaiting it in my code as well... 13:26
timotimo OK, damn :\
Zoffix I didn't have these issues last December, when I wrote the first version of IRC::Client 13:27
13:27 araujo_ left 13:28 araujo_ joined 13:30 araujo_ left, araujo_ joined 13:32 araujo_ left, araujo_ joined 13:34 araujo_ left, araujo_ joined
jnthn sammers: Or unit role Foo or unit grammar Foo... Any of the package declarators work. 13:39
13:43 kaare_ joined
sammers jnthn: thanks. just trying out different approaches. 13:51
13:55 colomon left 13:56 colomon joined
dalek c: c962649 | (Jan-Olof Hendig)++ | doc/Type/Nil.pod:
Fixed small error in code example
13:57
13:58 colomon left 13:59 colomon joined 14:00 AlexDaniel joined 14:01 colomon left 14:03 colomon joined 14:10 colomon left
jnthn 'win 3 14:10
oops ;)
14:12 colomon joined
Zoffix Damn. Having another baffling issue with my code :S IRC::Client is cursed 14:13
14:14 colomon left 14:16 BenGoldberg joined
Zoffix For some reason, this loop always launches just a single IO::Socket::Async: github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L21 And if I comment out one or the other server conf here, both work alone, but just one launches when two are specified :S github.com/zoffixznet/perl6-IRC-Cl...ot.pl6#L18 14:16
And the `say` in the loop does print both servers when both are provided in config :S
timotimo for $events.grep: *.defined -> $e { - i'm surprised this works 14:17
syntax-wise
14:17 pierre_ joined
Zoffix seems same as `for $x -> $e {` to me 14:18
14:19 colomon joined
DrForr Is supernous on IRC? 14:20
*novus
timotimo only rarely
!seen supernovus
AlexDaniel .
timotimo .seen supernovus
yoleaux I saw supernovus 22 Apr 2016 23:27Z in #perl6: <supernovus> Well, I'm going to have to run. Have a great day/night everyone. I hope to fix up some of my long neglected libraries at some point when I'm not completely overloaded with work! :-)
DrForr Okay, cool. I just noticed an awkwardness with Web::Template, going to submit a PR when I'm done. 14:21
14:21 khw joined 14:22 pierre_ left
BenGoldberg Zoffix, This doesn't seem right: github.com/zoffixznet/perl6-IRC-Cl...t.pm6#L115 ... it looks like you discard the text which you'd be printing to the log if Terminal::ANSIColor couldn't load. Surely you only want to discard the color? 14:25
Zoffix BenGoldberg, ah, thanks. It used to be color() but I switched to colored() and that sub needs to be changed.
BenGoldberg++
BenGoldberg :) 14:26
stevieb9 Zoffix: what gaming platform do you play on? 14:27
Zoffix The one with real hardware.
And not something you get out of a cereal box :) PC Master Race! 14:28
14:28 colomon left 14:29 colomon joined, aries_liuxueyang joined
ugexe jdv79: i missed your comment on zef yesterday. im pretty sure it was due to me removing an old precomp hack (-Ilib/.precomp) for speed purposes. now i suspect its still needed for pre-locatable-precomp rakudo 14:29
14:33 colomon left 14:34 colomon joined
Zoffix My issue was sharing variables across threads. This locked fixed (at least some of) the issues: github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L25 14:35
14:38 BenGoldberg left, nowan joined 14:39 colomon left
ugexe jdv79: can you tell me what rakudo version that happens on? I just tried on 2016.01 and it installed still, so maybe my suspicion is wrong 14:40
14:40 colomon joined
ugexe Zoffix: doesn't seem like you should need to do that, so maybe its something deeper 14:42
Zoffix ugexe, isn't creating new keys in a hash not thread safe? 14:43
14:43 BenGoldberg joined
Zoffix But I also had to take care of this one: github.com/zoffixznet/perl6-IRC-Cl...t.pm6#L111 so maybe that was the original problem anyway. I removed the Lock now and everything still works, it seems (I moved state &colored to the top of the file) 14:44
ugexe im not sure how that would happen with what im looking at though
14:45 jaffa4 joined, colomon left 14:46 colomon joined
Zoffix each thread creates %.servers<a><socket> and %.servers<b><socket> (<a> and <b> exist already, but <socket>s don't). 14:51
ugexe oh i see, `<socket> =` is inside the .then 14:55
so the `for` loop can advance before assignment
14:56 zakharyas joined, BenGoldberg left
ugexe are you on osx by chance? 14:58
14:59 |sir is now known as |2701
Zoffix No, Bodhi Linux 15:00
15:01 kurahaupo joined, molaf joined, BenGoldberg joined 15:02 colomon left, colomon joined
ugexe hmm, well you might try (before the await): `%!server.values.map(*.promise)>>.result`. On osx in the past i've had similar problems where calling a superfluous `.result` was needed to sink the promise and leave the Planned state 15:04
15:08 rindolf joined, colomon left, hankache joined
hankache m: { our $var = 'Text'; say $var.WHERE; } { our $var = 123; say $var.WHERE; } say ::('$var').WHERE; 15:09
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JBoVjUQdkL␤Unexpected block in infix position (missing statement control word before the expression?)␤at /tmp/JBoVjUQdkL:1␤------> 3{ our $var = 'Text'; say $var.WHERE; }7⏏5 { our $var = 123; say $va…»
hankache m: { our $var = 'Text'; say $var.WHERE; }; { our $var = 123; say $var.WHERE; }; say ::('$var').WHERE; 15:10
camelia rakudo-moar 85682a: OUTPUT«140562260749928␤140562260934880␤140562260934880␤»
15:10 brrt left
hankache should this be allowed ^^ 15:10
is it normal?
Zoffix m: class Foo { has @.foo; }; my %args = foo => [^5]; Foo.new(|%args).foo.elems.say 15:11
camelia rakudo-moar 85682a: OUTPUT«1␤»
Zoffix Is there a trick to make that return 5? So [^5] results in @.foo = 0, 1, 2, 3, 4 ? 15:12
ugexe has $.foo
Zoffix Hmr. OK
ugexe or flatten in a constructor
timotimo .end isn't what you want, right?
oh, now i see what you mean
Zoffix "Segmentation fault" ahahah 15:13
And it's flappy too... Restarting the script doesn't show it again ~_~
jnthn Zoffix: Ugh...if you could file the reproduction code for that somewhere, I can take a look at some time when I'm less tired. :)
Zoffix It's pretty big. My IRC::Client rewrite.... And it's not happening reliably 15:14
jnthn ugexe: btw, that "OSX bug" with promises wasn't OSX specific, and got fixed a few weeks back :) 15:15
Zoffix Well, "reliably" isn't even a word... I restarted it a dozen times now without any issues. It's a ghost bug
jnthn ugexe: 1ee27e660a8dc 15:16
15:16 Actualeyes left
jnthn Zoffix: Yeah, that's what makes them so hard to hunt, but there's various things I can do to tease them out, so still worth filing flappy stuff. 15:16
jnthn afk for a bit 15:17
ugexe jnthn: i'll have to check the gist in this rt when i can access osx again, but the one im talking about was definitely osx specific rt.perl.org/Public/Bug/Display.html?id=125758
but if it is the same thats an RT that can be closed 15:20
15:23 buharin left
Zoffix jnthn, well, I filed it, though it's big and complex to run, so I doubt how much use there is: rt.perl.org/Ticket/Display.html?id=128323 15:23
m: await ^5 .map: { IO::Socket::Async.connect( 'irc.freenode.net', 6667).then: { say .result } } 15:25
camelia rakudo-moar 85682a: OUTPUT«IO::Socket::Async.new␤IO::Socket::Async.new␤IO::Socket::Async.new␤IO::Socket::Async.new␤IO::Socket::Async.new␤»
jdv79 ugexe: i was just using latest 15:26
15:29 Actualeyes joined 15:31 abruanese joined
ugexe hmm, its not freezing for me on a build from June 3rd. all i can think of is deleting ~/.zef and ~/.perl6 (or `zef nuke RootDir home`), but i'm not sure why that should fix it even if it does work 15:36
jdv79 just a moment 15:37
ugexe if you also run with RAKUDO_MODULE_DEBUG=1 it'll probably make it clear if its a precomp problem at least
15:37 hankache left
jdv79 its a fresh acct and fresh p5 and p6 and well, everything 15:39
15:44 wamba left
MadcapJake can anyone provide some input into what I could do to differentiate between `is` the trait_mod operator and `is` the Test function github.com/MadcapJake/language-per.../issues/29 15:50
15:51 wamba joined 15:53 _4d47 joined, IRCBot1465142030 joined 15:55 mohae joined
Zoffix See if it's preceeded with <[};]>\s* ? 15:55
Won't catch everything, but... ¯\_(ツ)_/¯
hm 15:56
m: class Foo { has $.foo where { $_ } is rw; }; my $x = Foo.new: :42foo; say $x.foo 15:57
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/lKI4uRIxv5␤Strange text after block (missing semicolon or comma?)␤at /tmp/lKI4uRIxv5:1␤------> 3class Foo { has $.foo where { $_ }7⏏5 is rw; }; my $x = Foo.new: :42foo; say ␤ expecting any of:…»
Zoffix Unsure if there's some case where curly/; preceeds a trait.
say hello 15:58
IRCBot1465142030 How about: HELLO
Zoffix :D Awesome. That bot is currently on three servers, with just a couple of extra words of config. AlexDaniel++ for pointing out the multi-server stuff :D
AlexDaniel Zoffix: honestly I didn't think that you would listen :) 16:00
Zoffix i.imgur.com/FFG853o.png
Bottom lines show stuff from other 2 servers :)
AlexDaniel Zoffix: but that's a nice feature, I think that many people will appreciate it 16:01
16:03 bisectable joined
MadcapJake Zoffix: The way I see it, `is` is a very common trait and could very easily be "continuated" on another line. With the current heuristics (yours included) `is` on a new line would be considered the Test function. I'm not sure I'm happy with that compromise. Thoughts? 16:04
stevieb9 are there any docs that are known incomplete or known to need some scrutiny? I've been going through doc-by-doc testing all the code examples to enforce what I'm learning, but perhaps while I'm doing so, I could focus on portions that are known to need some work
AlexDaniel stevieb9: github.com/perl6/doc/issues?q=is%3...writing%22 16:05
stevieb9: or maybe even see the complete list, not just 「needs writing」: github.com/perl6/doc/issues
stevieb9 AlexDaniel: thanks a lot!
AlexDaniel stevieb9: docs need more love. Your help will be appreciated 16:06
stevieb9 AlexDaniel: yep, and writing PRs/patches will further help me pick things up, and help everyone in the future. 16:07
Zoffix MadcapJake, I meant mark it as function *only* when it's preceeded by '}' or ';'
MadcapJake ahh well, then we're still left with the current state: `is` on a new line is considered a trait 16:08
Zoffix MadcapJake, but that ticket really feels more as a won't-fix to me. I mean, it's a function from a module. What if someone names a function `but`? It'd be highlighted as a trait
Looks the same on my theme anyway: i.imgur.com/i6SiZ0u.png 16:09
MadcapJake yeah I'm thinking that too, I can't think of anything that would more fully distinguish `is` 16:10
16:10 Sgeo_ joined
MadcapJake Zoffix: that's cus it's still considered trait_mod operator there 16:10
16:10 Ven left
Zoffix Oh, right.. I'm dumb :D 16:10
MadcapJake I don't have anything in there currently that distinguishes (I could add a simple "^is" for the Test function) 16:11
AlexDaniel OK, *ding ding ding ding*. Last time I introduced bisectable (irclog.perlgeek.de/perl6/2016-05-20#i_12514921), but some people pointed out that it is LTA because it does not check if the query makes sense.
well, guess what!
bisect: exit 42
bisectable AlexDaniel: (2015-12-25) github.com/rakudo/rakudo/commit/07fecb5
AlexDaniel what 16:12
Zoffix giggles
AlexDaniel sorry, that's the old version
16:12 bisectable left 16:13 bisectable joined
AlexDaniel bisect: exit 42 16:13
bisectable AlexDaniel: on both starting points the exit code is 42 and the output is identical as well
AlexDaniel ah ok
Zoffix \o/ 16:14
AlexDaniel but notice how it talks about the output
which means that…
well, let's take a look at one example
bisect: exit 1 if (^∞).grep({ last })[5] // 0 == 4 # RT 128181
bisectable AlexDaniel: (2016-03-18) github.com/rakudo/rakudo/commit/6d120ca
AlexDaniel previously I was showing this example
but now you can simplify it to this
bisect: say (^∞).grep({ last })[5]
bisectable AlexDaniel: exit code is 0 on both starting points, bisecting by using the output
AlexDaniel: (2016-03-18) github.com/rakudo/rakudo/commit/6d120ca
Zoffix :o
AlexDaniel look! You don't have to CATCH anything, you don't have to care about the exit code! 16:15
Zoffix Sweet. AlexDaniel++
AlexDaniel even the dumbest person out of all idiots (like me) can now use it!
by the way, if anybody is wondering what is going to happen if you accidentally switch good and bad revisions 16:16
bisect: good=2016.03 bad 2016.02 say (^∞).grep({ last })[5]
bisectable AlexDaniel: exit code is 0 on both starting points, bisecting by using the output
AlexDaniel: “bisect run” failure
AlexDaniel that's a bit LTA (mainly beacuse git itself has a good error message for this case), but it is still fine 16:17
bisect: for ‘q b c d’.words -> $a, $b { } 16:18
bisectable AlexDaniel: (2016-06-05) github.com/rakudo/rakudo/commit/85682a5
AlexDaniel … there's still some room for improvement though…
16:19 Guest690 is now known as parisba
_4d47 m: class A { has $.wut = [] }; my $a = A.new; $a.wut = [1,2,3]; $a.wut 16:21
camelia ( no output )
Zoffix m: class A { has $.wut = [] }; my $a = A.new; $a.wut = [1,2,3]; $a.wut.say
camelia rakudo-moar 85682a: OUTPUT«[1 2 3]␤»
_4d47 m: class A { has $.wut = [] }; my $a = A.new; $a.wut = [1,2,3]; dd $a.wut
camelia rakudo-moar 85682a: OUTPUT«[1, 2, 3]␤»
Zoffix wtf is it writable :S 16:22
m: class A { has $.wut }; my $a = A.new; $a.wut = [1,2,3]; dd $a.wut
camelia rakudo-moar 85682a: OUTPUT«Cannot modify an immutable Any␤ in block <unit> at /tmp/2BHCN8yCLh line 1␤␤»
Zoffix m: class A { has $.wut = 42 }; my $a = A.new; $a.wut = [1,2,3]; dd $a.wut
camelia rakudo-moar 85682a: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at /tmp/Ei2grkkbSp line 1␤␤»
_4d47 on classtut doc and was expecting wut to be read-only 16:23
Zoffix bisect: class A { has $.wut = [] }; my $a = A.new; $a.wut = [1,2,3]; $a.wut.say 16:24
bisectable Zoffix: (2016-06-05) github.com/rakudo/rakudo/commit/85682a5
Zoffix _4d47, that looks like a bug to me. You should report it. 16:25
Though maybe this is due to container stuff
m: class A { has $.wut = %() }; my $a = A.new; $a.wut = 1,2,3,4; dd $a.wut
camelia rakudo-moar 85682a: OUTPUT«Hash % = {"1" => 2, "3" => 4}␤»
Zoffix Yeah, probably.
m: class A { has %.wut }; my $a = A.new; $a.wut = 1,2,3,4; dd $a.wut 16:26
camelia rakudo-moar 85682a: OUTPUT«Hash %!wut = {"1" => 2, "3" => 4}␤»
Zoffix :S
_4d47 Zoffix: what is = %() ? 16:27
Zoffix empty hash
16:27 parisba left 16:28 parisba joined
BenGoldberg bisect: Scalar.new = 5 16:30
bisectable BenGoldberg: on both starting points the exit code is 1 and the output is identical as well
BenGoldberg bisect: m: (^100).pick(*).map: { start { sleep $_; .say } }
bisectable BenGoldberg: exit code is 0 on both starting points, bisecting by using the output
BenGoldberg: (2015-12-27) github.com/rakudo/rakudo/commit/1bdb784
_4d47 Zoffix: where should I report ? 16:31
Zoffix huggable, rakudobug 16:32
huggable Zoffix, [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs
Zoffix _4d47, ^
_4d47 ok great thanks ! 16:33
BenGoldberg bisect: use nqp; nqp::const::just_a_test;
bisectable BenGoldberg: on both starting points the exit code is 1 and the output is identical as well
16:34 Ven joined 16:36 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
BenGoldberg bisect: m: my $x := (my $y := $x); say $x.WHAT; 16:36
bisectable BenGoldberg: exit code is 0 on both starting points, bisecting by using the output
BenGoldberg: (2016-04-13) github.com/rakudo/rakudo/commit/ae2ae92
16:38 Aliv3 joined 16:40 Ven left 16:43 Ven joined 16:44 mohae left 16:55 Ven left 16:57 mohae joined 17:01 girafe joined 17:03 Ven joined 17:09 Deep_Thought left 17:10 Ven left 17:11 buharin joined
jdv79 ugexe: any ideas about that issue? 17:11
maybe i should just use an older release
ugexe gimmie a minute, im writing down what i know 17:12
17:12 user9 joined 17:14 IRCBot1465142030 left 17:16 IRCBot1465147004 joined 17:21 vendethiel joined
gfldex lizmat: if I understand Mu.Capture right, it will only return a non-empty Capture when public accessors are present. That means it will silently drop data. A NYI would be more helpful. 17:21
17:22 Ven joined
gfldex m: say 10.Capture // \(10); 17:24
camelia rakudo-moar 85682a: OUTPUT«\()␤»
17:25 _mg_ joined, user9 left
gfldex m: say 10.Capture || \(10); 17:25
camelia rakudo-moar 85682a: OUTPUT«\(10)␤»
17:26 Ven left
jdv79 does travis do a new build if a dep changes? 17:26
for instance Inline::Perl5 on rakudo changes? or does it run periodically?
ugexe no, only on new commits/PRs 17:27
jdv79 gah
gfldex jdv79: see github.com/travis-ci/travis-ci/issues/631 17:28
jdv79 isn't the C in CI continuous? 17:29
it'd be super simple to just do _that_ like cpan testers do
ugexe: same results with selinux off 17:30
17:31 user9 joined
ugexe damn. i don't have the slightest idea where to even look next 17:32
jdv79 nine: how do we fix it?
17:35 Actualeyes left 17:36 Actualeyes joined 17:42 Ven joined
stevieb9 is there a doc for contributing to docs? I'm going to try to tackle github.com/perl6/doc/issues/530 to get started, but want a better idea of how the 'Defined as:' sections are generated (or if they're manually created) etc 17:44
17:45 Actualeyes left 17:46 brrt joined, user9 left
jdv79 there's a repo ^H 17:49
github.com/perl6/doc 17:50
and there is a CONTRIBUING.md file. i've just does PRs or commits on that repo in the past.
*done
17:50 BenGoldberg left, Aliv3 left
DrForr m: "hi [[there]]" ~~ s:g{ '[[' ( .+? ) ']]' } = qq{<a href="$0"/>}; 17:51
camelia rakudo-moar 85682a: OUTPUT«Cannot modify an immutable Str␤ in block <unit> at /tmp/7SyIMd2Yg1 line 1␤␤»
DrForr m: my $x= "hi [[there]]";$x ~~ s:g{ '[[' ( .+? ) ']]' } = qq{<a href="$0"/>}; say $x 17:52
camelia rakudo-moar 85682a: OUTPUT«hi <a href="there"/>␤»
DrForr m: my $x= "hi [[there]]";$x ~~ s:g{ '[[' ( .+? ) ']]' } = qq{<a href="$0">$0</a>}; say $x
camelia rakudo-moar 85682a: OUTPUT«Use of Nil in string context in code at /tmp/TWw6c70S4Y line 1␤hi <a href="there">␤»
17:53 |2701 left
DrForr $0 can't be used twice? Or I'm not understanding something? 17:53
Probably the latter, but I'm confused.
17:54 user9 joined
teatime DrForr: is $0</a> being interpreted as a hash lookup? 17:56
DrForr Oh, good point.
jdv79 DrForr: i can't even read that. are you assigning to a subst? i must be blind. 17:57
DrForr Yeah, that's how it's interpreted. {$0}</a> worked just fine. 17:58
jdv79: YEs.
*Yes
jdv79 what does it mean ^H? 17:59
DrForr In old-sk00l s{\[\[(.+)\]\]}{<a href="there/$1">$1</a>}g; 18:00
jdv79 is that syntax doc'd? the new i mean?
not sure i've ever seen it
DrForr Well, I did the alternate version, I think someone did the original... 18:01
geekosaur it's in the synopses; may not be in the docs 18:02
jdv79 so the second levels docs:)
*level
geekosaur the real docs, not the speculations
:p
jdv79 oh its inte hdocs 18:03
18:03 user9 left
jdv79 last part of doc.perl6.org/language/operators#Su..._Operators 18:03
DrForr Hrm, more yak shaving or getting something ready.... I vote the latter. 18:04
jdv79 it's be easier to just do s{foo}{bar} no? like p5 does. 18:06
*it'd
18:09 _nadim joined
psch m: $_ = "foo"; s{foo}{bar}; .say 18:09
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/45Hs1UNQ2x␤Unsupported use of brackets around replacement; in Perl 6 please use assignment syntax␤at /tmp/45Hs1UNQ2x:1␤------> 3$_ = "foo"; s{foo}7⏏5{bar}; .say␤»
jdv79 its just a wat syntactically for me (the new assigment/replacement part) 18:10
18:10 Ven left
psch jdv79: s/// just doesn't support paired delimiters anymore 18:11
well, not without pulling the regex and replacement apart 18:12
18:12 brrt left
psch FSVO "anymore" 18:12
i mean, Perl 6 is not a "next version" after all :)
18:12 Ven joined
mst I'm sure there was a very early revision of perl6 that supported it for at least one commit 18:14
and if anybody challenges you, they can go through every commit ever to rakudo and niecza and pugs to prove you wrong, clearly :D
psch fair point :)
18:15 zakharyas left
geekosaur am pretty sure that did work in pugs. but it was a PITA to parse sanely so it went away 18:18
(pugs iirc cheated)
psch by tossing one pass parsing i guess? 18:19
geekosaur and yes, it does work in perl5, but perl5's parsing is a mess of special cases
I think pugs got that case to work but lost others instead 18:20
and trying to make those others work led to the realization that it wasn't going to ever be sane
pugs went through a lot of that, it's the reason the file tests changed so much before reaching their current form 18:22
(they started out being similar to perl5)
18:26 Ven left
DrForr Well, I'm going to rewrite it properly as a grammar, but I thought a stopgap solution would work for the time being. 18:30
18:32 Ven joined 18:43 BenGoldberg joined 18:45 ssotka joined
nine jdv79: fix what? 18:46
18:46 girafe left
stevieb9 nine: I *think* jdv79 meant how to make travis do a full build if a dep is committed to 18:49
18:53 setty1 joined
stevieb9 here's a doc that hints that alternate delims were at once available in regex substitution: search.cpan.org/~dconway/Perl6-Rule...stitutions 18:55
psch m: $_ = "foo"; s!foo!bar!; .say 18:56
camelia rakudo-moar 85682a: OUTPUT«bar␤»
Zoffix Well, it still works with s{foo} = {bar} or whatever the correct way to spell the form with an equals sign is
18:56 zakharyas joined
stevieb9 sorry... *paired* delimiters, ie. {} 18:56
mst I actually quite like the assignment form 18:58
maybe I'm just weird
Zoffix m: $_ = 'foobar'; s{foo} = 'meow'; .say
camelia rakudo-moar 85682a: OUTPUT«meowbar␤»
Zoffix m: $_ = 'foobar'; s{foo} = {}; .say
camelia rakudo-moar 85682a: OUTPUT«bar␤»
Zoffix m: $_ = 'foobar'; s{foo} = {meow}; .say 18:59
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Zr66Jk_y_f␤Undeclared routine:␤ meow used at line 1␤␤»
Zoffix The last example in this section should probably be amended as it implies {} is just a way to write an empty string and you can put any string there: docs.perl6.org/language/operators#S..._Operators
m: $_ = 'foobar'; s{foo} = q{meow}; .say
camelia rakudo-moar 85682a: OUTPUT«meowbar␤»
psch yeah, that example is a bit weird 19:00
19:00 colomon joined
psch i'd rather it just uses an empty Str 19:00
m: say {} 19:01
camelia rakudo-moar 85682a: OUTPUT«{}␤»
psch m: print {}
camelia ( no output )
psch m: print ~{}
camelia ( no output )
psch m: print Hash.new 19:02
camelia ( no output )
AlexDaniel m: m: say ‘hello’
camelia rakudo-moar 85682a: OUTPUT«hello␤»
Zoffix m: {}.WHAT.say
camelia rakudo-moar 85682a: OUTPUT«(Hash)␤»
AlexDaniel is m: a label here? ↑
19:03 abruanese left, Zero_Dogg left 19:04 Zero_Dogg joined, colomon left
masak AlexDaniel: yes 19:07
yoleaux 00:20Z <raiph> masak: re "when (*, * < 0) { ... }"; does "when (*; * < 0) { ... }" work for your use case?
Zoffix m: m: loop { loop { last m if $++ > 5; say $++ }; say "yup" }
camelia rakudo-moar 85682a: OUTPUT«0␤1␤2␤3␤4␤5␤»
yoleaux 00:25Z <TimToady> masak: or were you expecting it to do (**, * < 0) instead?
psch m: m: while True { last m if $++ > 3; LEAVE { say "\o/" } }
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sJJ7Si18Pb␤Unrecognized backslash sequence: '\o'␤at /tmp/sJJ7Si18Pb:1␤------> 3True { last m if $++ > 3; LEAVE { say "\7⏏5o/" } }␤ expecting any of:␤ argument list␤ double quo…»
psch m: m: while True { last m if $++ > 3; LEAVE { say '\o/' } }
camelia rakudo-moar 85682a: OUTPUT«\o/␤\o/␤\o/␤\o/␤\o/␤»
psch m: m: while True { last m if $++ > 3; LAST { say '\o/' } }
camelia rakudo-moar 85682a: OUTPUT«\o/␤»
Zoffix while True!
Zoffix shakes head.
psch keep mixing these up :/
Zoffix How un-Perl-6-like :)
19:07 buharin left
psch Zoffix: what else? 'while [*]'? :P 19:08
19:08 buharin joined
Zoffix psch, loop { } 19:08
psch oh, right, we have that
Zoffix :)
masak m: given (1; -3) { when (*; * < 0) { say "yup, that works" }; default { say "sorry, no" } } 19:10
camelia rakudo-moar 85682a: OUTPUT«yup, that works␤»
masak raiph: seems that could work :) 19:11
grondilu about loop {}, can't help but: www.perlmonks.org/?node_id=1057242
I know it's old, but I keep thinking about it from times to times. 19:12
19:15 spider-mario joined 19:19 labster joined 19:20 araujo__ joined 19:24 araujo_ left
buharin hi guys 19:26
AlexDaniel m: sleep ∞ 19:28
camelia rakudo-moar 85682a: OUTPUT«(timeout)» 19:29
Zoffix m: sleep sleep
buharin, just guys? :)
buharin yep 19:30
no girls here
camelia rakudo-moar 85682a: OUTPUT«(timeout)»
Zoffix Man, social media is such a waste of time.... 19:31
Zoffix leaves to play Assassin's Creed
AlexDaniel
.oO( Perl 6 – free sex change for every IRC user )
19:32
19:33 mst joined, ChanServ sets mode: +q *!*@90-156-117-46.internetia.net.pl
mst buharin: (1) not true (2) ye gods, are you actually *trying* to make female hackers feel unwelcome in here? (3) as standard for such comments, you are now quieted for 24h while you go away and think about it. 19:34
Zoffix mst++
"chainsaw-wielder"? Nice host lol
19:36 rindolf left
AlexDaniel agrees that it was deserved 19:36
MasterDuke: are you going to submit another pull request? 19:38
MasterDuke AlexDaniel: yeah, i'm moving the non-duplicative tests to S03-operators/relational.t 19:44
AlexDaniel ok
mst I strongly suspect that it was largely 'lack of thought' on his part, but that's why I use a standard of '24h tempban' rather than anything heavier 19:45
gnull hello everyone 19:50
Zoffix \o
DrForr Evenin'. 19:52
gnull I was reading documentation on `race` sub at doc.perl6.org/type/Iterable#method_race
s/sub/method/
geekosaur will preemptively point out that race is known buggy currently
there's a couple of open "where'd my results go?" tickets 19:53
19:53 BenGoldberg left
gnull Hmm, that is why it segfaults)) 19:53
A couple of times 19:54
Zoffix likely
gnull, here's my version of a .race-like Promise-using code: gist.github.com/zoffixznet/ae7bcf0...917238ff1a
19:54 BenGoldberg joined
Zoffix It may have an off-by-one error, unsure. 19:55
AlexDaniel gnull: do you have a golfed down version?
gnull: .race does not work, yes, but I've never seen it segfault
mst geekosaur: ah, it's currently providing WORN storage 19:56
19:57 btyler joined
Zoffix WORN? 19:57
jnthn Write Once, Read Never? :) 19:58
gnull I'm using version from rakudo-star-2016.04.tar.gz downloaded from rakudo.org
Zoffix heh
mst what jnthn said :D 20:00
gnull the segfaulting code looks like: for @list1.race(batch => 2, degree => 2) { for @list2 { shell "some-command" } } 20:01
btyler hi folks -- a question about promises/concurrency. is it a reasonable thought that I should be able to use promises similarly to goroutines or erlang processes? that is, potentially long-lived little units of concurrent action, like 'promise per web request' in a web server
geekosaur hm I bet threading and forking do not mix very well
on posix at least that's a minefield
gnull excuse me, the previous code doesn't segfault
20:01 yqt joined
btyler (I'm giving a talk that says _yes_! they should!, but I should ask around so I can tell people if this is a good thing or just a crazy thing) 20:01
gnull changing @list2 to $list2 makes it segfault 20:02
In C if you use clone/fork directly it should be OK 20:03
I mean the case when fork() is followed by exec()
AlexDaniel gnull: can you provide a full example? I'm having troubles reproducing it 20:04
mst btyler: that's basically how IO::Async based web stuff works 20:06
btyler: (in perl5)
Zoffix btyler, yeah, they run concurrently, [potentially] in a different thread. No idea about goroutines or erlang, but with Promises you have to be careful modifying data that's shared across them. 20:08
btyler mst: can you expand on that? I'm familiar with AnyEvent and the mojo concurrency bits; is IO::Async substantially different? I guess the core property I'm asking about is cooperative vs pre-emptive scheduling. pretty much all async in perl5 is event loop based, so it's cooperative and you need to avoid sleep(5)/blocking queries/etc.
Zoffix btyler, you can sleep in promises 20:09
btyler promises are cooperative on the function termination, so if your # of concurrent promises tops out the thread pool you block
Zoffix: until you max out the thread pool, and then no new promises get run while the current batch are sleeping :)
well, let me upgrade all the things, maybe I'm behind the times
Zoffix m: await ^10 .map: { start sleep 1; }; say now - INIT now; 20:10
camelia rakudo-moar 85682a: OUTPUT«1.00491933␤»
Zoffix m: await ^100 .map: { start sleep 1; }; say now - INIT now;
camelia rakudo-moar 85682a: OUTPUT«Memory allocation failed; could not allocate 15080 bytes␤»
Zoffix m: await ^20 .map: { start sleep 1; }; say now - INIT now;
camelia rakudo-moar 85682a: OUTPUT«Memory allocation failed; could not allocate 15072 bytes␤»
AlexDaniel Zoffix: :P
gnull AlexDaniel: The program is here gist.github.com/gnull/d9fa51cb5b34...244152aac. It uses a couple of text files when running, so I uploaded an archive here www.dropbox.com/s/9rtu6bwewmuodco/....tar?dl=0.
AlexDaniel Zoffix: 10 kbytes should be enough for everyone
mst btyler: IO::Async is all based around Future these days 20:11
btyler mst: sure, but it still runs an event loop under the hood, so we're still talking about cooperative scheduling, yeah?
mst btyler: AnyEvent is a bag of razorblades and teaches you very little except "don't use AnyEvent for production code"
AlexDaniel gnull: alright, I'll give it a try here
btyler e.g. if I sleep(5) in my future, everything stops
is that right?
mst btyler: yes. but the one-future-per-request approach still works fine.
btyler as long as you don't use a blocking DBI call
mst my point here is that even *without* the multithreading stuff, it's a good pattern
Zoffix btyler, what's "everything"?
m: await ^10 .map: { start sleep 1; }; say now - INIT now; 20:12
camelia rakudo-moar 85682a: OUTPUT«1.006371␤»
Zoffix btyler, ^ 10 1-second sleeps finish in 1 second.
gnull AlexDaniel: core dump appears in a couple of minutes if you are interested.
btyler Zoffix: in a single threaded event loop (as in pretty much all perl 5 concurrency libs that I know of) sleeping blocks the loop, so nothing happens
mst btyler: yes, we know
btyler sorry, that was in regards to perl 5, responding to mst
Zoffix btyler, this is Perl 6
mst btyler: please stop stating random obvious things that are nothing to do with what I said
Zoffix: yes, please read what *I* was saying
gnull I guess I should have compiled perl6 with debugging symbols.
mst grumbles
btyler mst: sorry! trying to answer two people
mst btyler: yes, but you're basically lecturing me on co-operative multitsaking 101 20:13
it's not actually helpful when I'm trying to make a point
so, starting again
btyler fair enough, apologies
mst given that, *even in perl5*, one future per request is a valid and pretty effective pattern 20:14
I would suggest that one promise per request in perl6 is merely going to be even better
Zoffix btyler, well, this is on a 2-core box, the ^number indicates the number of promises started and each sleeps for 1 second. The output indicates the number of seconds the program ran: gist.github.com/zoffixznet/1eb5aab...f17f6f0749
mst Zoffix: hush
Zoffix btyler, so there isn't an unlimited amount of threads, but I think even that can be increase as well.
btyler Zoffix: yep, thanks, give me a minute to hash it out with mst
mst Zoffix: this was a question about one promise per request as a pattern originally 20:15
can we complete that before you start talking thread pools?
20:15 Zoffix left
AlexDaniel gnull: well, it would be nice to have a bug report 20:15
mst btyler: I've tended to find that you end up with two sorts of 'thing', as it were
tasks, whose primary prupose is to fulfill or fail a single promise
and services, which are longer running and I think in perl6 I'd expect to be watching a channel/supply 20:16
AlexDaniel gnull: ok, after several runs it actually segfaulted
mst btyler: but, yeah, basically, I think you're on the right track
btyler mst: ok, my apologies, XY'd 20:17
mst has code on his dev box to add decent future support to Mojo as well
because I want access to the mojo ecosystem too but after p3rl.org/Future and p3rl.org/Future::Utils I don't want to deal with callbacks again
btyler mst: let me back up: with IO::Async using a future-per-request pattern, I assume the same cavaets about blocking DBI calls apply as they would to anyevent/mojo under callbacks
gnull AlexDaniel: should I create an issue for moarvm or submit it somewhere for rakudo?
mst btyler: well, yes, of course, it's still one process 20:18
btyler right
mst btyler: one of the things I wanted access to here was Mojo::Pg
btyler: and, yeah, you have to create a timer future rather than a sleep
remember that async/await can be rewritten into promises
effectively, in perl5, you do that yourself, and in perl6, the language does it for you 20:19
AlexDaniel gnull: actually, your code can be simplified
let's see
mst but, either way, promise-per-request worsk really well
btyler: note that AE's condvars are *almost* like futures except full of sharp edges
so if you think of the times you used condvars and it went *right*, that's also evidence
btyler those same cavaets _do not_ apply in erlang or go, because the $unit-of-concurrency blocking on a DB query will get shoved off the CPU. I'm trying to clarify if Perl6 Promises should be treated as subject to those blocking cavaets or not 20:20
right now the situation is "you're fine doing blocking stuff...until you exhaust the thread pool"
gnull AlexDaniel: The interesting thing is that it doesn't segfault (al least for me) if you s/$exploits/@exploits/g
AlexDaniel gnull: usually such things are mailed to [email@hidden.address]
btyler DB query is a potentially misleading example, same applies for plain old CPU bound code in erlang/go 20:21
AlexDaniel gnull: that is, all bugs are here: rt.perl.org/
mst btyler: aha, I see. though, I mean, go has MAXPROCS and erlang has schedulers
btyler yes
perl6 also has that, after a fashion
mst I guess it depends on whether rakudo+moarvm does suspend and resume so thread pool is equivalent to that
and, er, that's above my paygrade
btyler right. right now it does not
but the current situation seems a bit caught in the middle
mst I *think* some of the stuff being worked on will?
I mean, I believe that's supposed to happen eventually
btyler my apologies for letting the conversation evolve into a tangent about perl5 async 20:22
mst in the meantime, I think I'd probably just stick to doing things as async as possible
it was fine, it was just annoying when you started trying to explain what co-operative multitasking was
but evidently I didn't make my "if this is a good pattern under co-op, one should assume it's even better under pre-emptive" thesis sufficiently clear 20:23
btyler ok, fair enough, that makes sense
AlexDaniel gnull: the problem here is not with just race
jnthn At the moment, `await` blocks a thread, and TheadPoolScheduler isn't overly smart in the "how many threads" question. Both are certainly up for being addressed. 20:24
btyler although it does strike me as a bit funky to use that under co-op without access to good async DB interaction? but you surely have more experience there, so if you say it works pretty ok, I'll take your word for it
AlexDaniel gnull: it is some kind of a general async problem
mst mmm
AlexDaniel gnull: I've seen that too many times but couldn't figure out how to rakudobug it
mst of course, if the thread's just sat there being blocked
you can probably afford to have lots of threads
jnthn (The await one first)
AlexDaniel gnull: just a second, I'll make your example really short
20:24 zakharyas left
mst jnthn: occasionally I envy C# its rewrite-to-futures approach to await 20:24
jnthn At the moment you can sorta overcome it by having a high limit for the thread pool. 20:25
btyler jnthn: hi! I suppose - design-wise, is the plan that promises will be preemptively scheduled across thread pool size, or they're meant to always and forever get an entire thread to themselves while executing?
jdv79 nine: can't get IP5 to work
jnthn mst: Well, yes and no. :) I mean, it's nice, but forces refactoring types all the way down the call chain. We already *have* continuations, so `await` should "just" use that.
mst jnthn: oh, yes, I said 'occasionally' 20:26
jdv79 ugexe says it works for him. maybe its a fedora or some other env factor?
AlexDaniel jnthn: by the way, this segfault is really annoying. I'd be happy if you took a look
when it is rakudobugged, of course
20:26 rindolf joined
mst jnthn: usually shortly followed by remembering all the other things you just said ;) 20:26
20:26 Ven left 20:27 buharin left
jnthn btyler: They already are scheduled across threads, it's just that when `await` blocks you gotta be careful how you write things so you don't exhaust said pool of threads. The idea was always that `await` would not work in that way, there simply wasn't time to get it done ahead of the xmas release, or at least not without putting aside other things that'd have been harder to change later. :-) 20:27
mst note: I'm about to head off. if I haven't lifted buharin's +q by about 6pm tomorrow, somebody please remind me 20:28
jnthn AlexDaniel: File it, I'll see if I can look at it during the next week...
AlexDaniel: race/hyper are in for attention relatively soon also...as usual, I have far more things I want to be doing than time to do them. :) 20:29
AlexDaniel jnthn: this issue is not about race/hyper specifically
although the rakudobugged code will probably include it :) 20:30
nine jdv79: details?
btyler jnthn: ok, thanks for the clarifying. to make sure I've understood correctly, the plan is for long-running promises to get pre-empted if you have more promises than threads in the thread pool, but it just isn't implemented yet
AlexDaniel gnull: ok, now I'm starting to remember :)
gnull: if you change it even a little bit, it stops segfaulting
gnull jnthn: Hmm, are you Jonathan Worthington? The guy that made that awesome talk on concurrency/parallelism/asynchrony? 20:31
www.youtube.com/watch?v=JpqnNCx7wVY
This talk i mean
lizmat gnull: yup, that's the guy 20:32
gnull jnthn: Great Talk! Thank you. It made me love perl more :)
jnthn btyler: Not *quite*. It's that we'll make `await` be something that yields control, though you won't have to think about it doing so (except in the cases where you do ;))
gnull: Glad you enjoyed it :)
AlexDaniel gnull: ok, I have some progress here 20:33
DrForr seen awwaiid 20:34
.seen awwaiid
yoleaux I saw awwaiid 31 May 2016 13:40Z in #perl6: <awwaiid> Increasingly Jupyter is wrapping more langs
AlexDaniel gnull: if I'm not mistaken, last time I had this problem, even adding some comments to the code made the segfault disappear…
literal m: my %h1 = bar => 3; my %h2 = bla => 4; for %h1.pairs.sort Z %h2.pairs.sort -> ($pair1, $pair2) { say "$pair1 and $pair2" }
camelia rakudo-moar 85682a: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in block <unit> at /tmp/LQCDZdxsJM line 1␤␤»
literal what's the right way to do this?
DrForr .tell awwaiid It seems that lrepl only lets you invoke one middleware layer at a time, is this by design? 20:35
yoleaux DrForr: I'll pass your message to awwaiid.
btyler jnthn: ah, ok. thanks, that's clear! I'll make sure to emphasize that any properties associated with preemptive scheduling won't apply entirely to perl6 (with the slight wiggle room about thread pool size)
btyler goes back to talk writing
jnthn m: my %h1 = bar => 3; my %h2 = bla => 4; for flat %h1.pairs.sort Z %h2.pairs.sort -> $pair1, $pair2 { say "$pair1 and $pair2" } 20:36
camelia rakudo-moar 85682a: OUTPUT«bar 3 and bla 4␤»
20:36 jaffa4 left
AlexDaniel “Internal error: Unwound entire stack and missed handler” :) 20:38
literal jnthn: I see 20:39
20:40 btyler left
jdv79 nine: i can't get through the testing phase of installation. i can pm you acct details where its happening i you wish. 20:40
20:41 TEttinger joined
jdv79 *if 20:41
AlexDaniel gnull: do I get it right that you have to run it multiple times to see a segfault?
gnull: or are you getting a segfault every single time? 20:42
gnull AlexDaniel: I've run it 10 times. Got 1 successfull run, 6 segfaults, 2 times 'Cannot invoke this object (REPR: Uninstantiable)' at line 21 20:46
And one got this:
Can only resume an exception object
in any at /home/gnull/prefix/share/perl6/runtime/CORE.setting.moarvm line 1
in sub THROW at /home/gnull/prefix/share/perl6/runtime/CORE.setting.moarvm line 1
in block at ./farm.p6 line 21
Sorry for long paste
AlexDaniel: The line 21 is 'say "$exploit $target";' 20:47
20:49 kaare_ left 20:50 _nadim left
AlexDaniel good 20:51
BenGoldberg hoelzro_, I'd like to suggest a possible improvement for multiline repl you figured out: Instead of merely catching X::Syntax::Missing, reading another line from the user, and re-EVAl-ing the lengthened string, what if you use .resume to continue parsing? 20:57
jdv79 nine: I imagine this is relevant: gist.github.com/anonymous/028fb20b...fa281809c2 21:04
21:05 rindolf left
ugexe if you let it run long enough a few other ones pop in for a single line once in a while 21:05
AlexDaniel gnull: ok, try this: gist.github.com/AlexDaniel/35252aa...af1c612320 21:06
gnull: e.g. run it in a loop to see all errors: while :; do ./segfault.p6; done
gnull: does it produce same errors? 21:08
gnull First time it gave: This Seq has already been iterated, and its values consumed (you might solve this by adding .cache on usages of the Seq, or by assigning the Seq into an array) in block at a.pl line 20 21:10
AlexDaniel: Then: Can only resume an exception object in any at /home/gnull/prefix/share/perl6/runtime/CORE.setting.moarvm line 1 in sub THROW at /home/gnull/prefix/share/perl6/runtime/CORE.setting.moarvm line 1 in block at a.pl line 20 21:11
AlexDaniel: One Segfault
AlexDaniel: Once `*** Error in `/home/gnull/prefix/bin/moar': double free or corruption ` with backtrace 21:12
AlexDaniel awesome. 21:13
yeah, something goes horribly wrong in this one :)
gnull: ok, so please submit rakudobug
gnull: either with your archive or with this shortened version, whatever you see fit 21:14
gnull AlexDaniel: backtrace is at gist.github.com/gnull/e4570fce92bc...d15b1a15d2
AlexDaniel gnull: even more awesome!
gnull AlexDaniel: Ok, thanks for help. 21:15
AlexDaniel gnull: unless you have an account on rt just write an email to [email@hidden.address] 21:16
gnull: and it will appear on rt.perl.org
21:23 girafe joined 21:31 _mg__ joined 21:34 _mg_ left, _mg__ is now known as _mg_ 21:37 |2701 joined
gnull AlexDaniel: done rt.perl.org/Ticket/Display.html?id=128325 21:39
21:42 gorgonzola joined
AlexDaniel .tell jnthn Here is the ticket: rt.perl.org/Ticket/Display.html?id=128325 (gnull++) 21:44
yoleaux AlexDaniel: I'll pass your message to jnthn.
AlexDaniel gnull: thank you very much! I'm hoping that this issue is actually broader than it seems, otherwise we'd have to figure out the problem with other similar segfaults :) 21:45
eh, RT has some problems with UTF-8… RT-- 21:46
gnull AlexDaniel: my emacs too :) so I just `wget`ed it and ran 21:48
AlexDaniel heh
gnull: well, I'm pretty sure that your emacs handles it just fine. Perhaps it is unable to render some characters (which is about fonts that you have installed), but there should be no encoding problems 21:49
literal is there a way to pass postcircumfix:«[ ]» to the 'handles' trait? 21:50
I'm trying to add indexing to a type, and I wondered whether "does Positional" and an appropriate 'handles' directive for an array variable would do... 21:51
gnull AlexDaniel: you are right, emacs works fine. It was github's viewer) 21:52
AlexDaniel: How do you type those characters? 21:54
gfldex we do not doc trait handles 21:55
literal: IIRC handles requires a method. Operators tend not to be methods.
gnull AlexDaniel: Are there '「' on your keyboard or you remeber utf-8 codes for them?
21:55 _4d47 left
AlexDaniel gnull: ‘’ “” «» 「」 – … ? I have them on my customized keyboard layout, so I just press a button… 21:55
gnull: but I also use compose key for stuff that I do not use every day 21:56
gnull: see this: doc.perl6.org/language/unicode_entry 21:57
gnull: ↑ it has a lot of useful info
gfldex literal: postcircumfix operators tend to delegate work to AT-KEY and other such methods. So you may still be able to do what you want.
AlexDaniel doesn't tell you how to create your own custom layout, but still it's good enough :)
gnull AlexDaniel: It's fun, thanks for the link 21:58
literal gfldex: I see
22:03 setty1 left
literal gfldex: ok, so it works if I do "handles <AT-POS>", but I wonder why it doesn't work with "handles *", does it exclude uppercase methods or something? 22:07
22:10 TEttinger left
gfldex literal: did you try `handles **`? 22:10
literal same result as * 22:11
is that new? I was testing this on Rakudo 2016.04 22:12
gfldex literal: no 22:14
22:16 _nadim joined
psch literal: what do you want 'handles *' to do? 22:16
22:16 wamba left
literal to delegate to AT-POS et al 22:18
gfldex literal: i can't see any special cases for captial spelled methods in github.com/rakudo/rakudo/blob/8cbb...ts.pm#L348 22:19
but i can see that you will have to expect slowness 22:20
psch literal: i assume that's dependent on the sigil of the Attribute? as in, 'has @.foo handles *' means 'handle all Positional methods', whereas 'has %.foo handles *' means 'handle all Associative methods'?
literal: what would that mean for & or $ sigil then?
22:22 girafe left
literal m: class Foo { has @.ary handles <AT-POS>; }; my $f = Foo.new(ary => [1, 2]); say $f[1] 22:22
camelia rakudo-moar 85682a: OUTPUT«2␤»
literal m: class Foo { has @.ary handles *; }; my $f = Foo.new(ary => [1, 2]); say $f[1]
camelia rakudo-moar 85682a: OUTPUT«Index out of range. Is: 1, should be in 0..0␤ in block <unit> at /tmp/abMhhz1X32 line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/abMhhz1X32 line 1␤␤»
literal psch: in this case the attribute has a @ sigil, and even if I change it to the $ sigil, "handles <AT-POS>" still works while "handles *" doesn't 22:24
psch literal: yes, i know. but what would you want it to do?
literal: should it *always* delegate as Positional, or did i guess right? 22:25
(both approaches are troublesome and too magic, fwiw)
literal I don't know, and it doesn't really matter to me. I just want "handles *" to make all methods (like AT-POS) be delegated
psch yeah, i'm pretty that's not going to happen in CORE 22:26
m: multi trait_mod:<handles>(Attribute \A, Whatever \w) { ... }
camelia ( no output )
literal then what does '*' mean, if not "everything" ?
psch that's your blueprint for implementing it yourself
just replace the stub with whatever way you want to decide which methods it should delegate 22:27
literal: * doesn't mean "everything". in most cases it means "i'll tell you later"
it's only array subscripting where it means "all elements you know"
but that's also not "everything" 22:28
although it's probably closest
well, and hash subscripting i guess
doc.perl6.org/type/Whatever for reference 22:29
22:30 kent\n joined, kent\n left, kent\n joined
literal alright then 22:32
different question. Why are expressions like this not allowed? 22:33
m: class Foo { has $.bar; method CALL-ME ($b) { self.new(bar => $b) } }; say Foo(Int(3434))
camelia rakudo-moar 85682a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YCM13i2rf6␤Unable to parse expression in typename; couldn't find final ')' ␤at /tmp/YCM13i2rf6:1␤------> 3 { self.new(bar => $b) } }; say Foo(Int(7⏏053434))␤»
psch m: class Foo { has $.bar; method CALL-ME ($b) { self.new(bar => $b) } }; say Foo(3434) 22:34
camelia rakudo-moar 85682a: OUTPUT«Foo.new(bar => 3434)␤»
literal I can make do with Foo(3434.Int), but if I have a custom type instead of Int, that won't work out of the box 22:35
psch if you have a custom type you can give it a CALL-ME as well, can't you?
not that i'd advocate for doing that, cause it feels somewhat messy to me... vOv
literal yes, and Foo(Bar($whatever)) won't work
due to Perl being unable to parse the expression 22:36
psch ah, right 22:37
hm, i'd have to build moar and check what exactly it parses there
literal in my case I'm trying to do something like $type = MyList(MyNum(123), MyString("foo"))
psch m: class A { method CALL-ME(Mu \a) { a } }; class B { method CALL-ME(Mu \b) { b } }; A($ = B(5)) 22:38
camelia ( no output )
psch just add throwaway containers vOv
m: class A { method CALL-ME(Mu \a) { a } }; class B { method CALL-ME(Mu \b) { b } }; A($(B(5))) 22:39
camelia ( no output )
psch ...or Scalar context i suppose
literal quite ugly :)
psch yeah, that's what i think about TypeName(arguments)
still, you might want to RT it
i don't see a good reason off-hand why it shouldn't parse, and if it's ticketed it'll either be decided as "should parse" or someone will write down a good reason why it shouldn't parse :) 22:40
literal alright
psch gets some sleep o/ 22:41
22:44 bjz_ left 22:45 colomon joined 22:54 huggable joined 23:02 kurahaupo left 23:07 bjz joined, kurahaupo joined 23:08 bjz left 23:09 bjz joined
kalkin-_ how can i speed up the rakudo rebuild? 23:10
i.e if i change somewhere a line and execute make it takes minutes till it's done on my xeon
23:13 Zero_Dogg left, Zero_Dogg joined
skids kalkin-_: you are compiling rakudo? That ued to take tens of minutes :-) 23:14
*used
kalkin-_ i must correct myself not minutes around 90seconds, but still :D 23:15
23:15 spider-mario left 23:17 bjz left
AlexDaniel BenGoldberg: honestly, it took me a while to figure out why your .pick(*).map snippet went “wrong”… 23:19
BenGoldberg: … but yea, trying to use a code snippet that fails *sometimes* is probably not a good idea for git bisect :D 23:20
23:21 |2701 left 23:22 sortiz joined
kalkin-_ how can i list all the set variables in the repl? 23:22
BenGoldberg :)
23:24 labster left
AlexDaniel BenGoldberg: it's also a bit sad that you'd have to bisect nqp yourself, but that's probably ok 23:30
23:30 araujo_ joined
AlexDaniel after all, it is already narrowed down for you :) 23:31
skids kalkin-_: there's nothing special about variables set in the REPL they are just variables 23:32
m: my $a = 42; my $b = 43; ::.keys.say # says the names of all variables in the current global scope.
camelia rakudo-moar 85682a: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! $b ::?PACKAGE GLOBALish $¢ $=finish $a $/ $?PACKAGE)␤»
skids m: my $a = 42; my $b = 43; ::.pairs.say # same, with values 23:33
camelia rakudo-moar 85682a: OUTPUT«($=pod => [] !UNIT_MARKER => (!UNIT_MARKER) EXPORT => (EXPORT) $_ => (Any) $! => Nil $b => 43 ::?PACKAGE => (GLOBAL) GLOBALish => (GLOBAL) $¢ => Nil $=finish => (Mu) $a => 42 $/ => Nil $?PACKAGE => (GLOBAL))␤»
23:34 araujo__ left
kalkin-_ skids: awesome thanks! 23:37
23:40 sortiz left
kalkin-_ how can i push a variable to the global scope? Am I blind or does perl6 not have any user defined global variables? 23:59