»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
AlexDaniel STD: loop (my $i = 0; $i <= 5; $i++ {;) { say } 00:04
std: loop (my $i = 0; $i <= 5; $i++ {;) { say } 00:05
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/safSS5UdoF line 1:␤------> 3loop (my $i = 0; $i <= 5; $i++ 7⏏5{;) { say }␤ expecting infix or meta-infix␤Parse failed␤F…»
00:05 amurf joined
AlexDaniel just wondered :) 00:06
00:10 amurf left
AlexDaniel m: loop { last if; } 00:12
camelia rakudo-moar 97ebe4: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'if'␤at /tmp/WSn69KnIQg:1␤------> 3loop { last if7⏏5; }␤Whitespace required after keyword 'if'␤at /tmp/WSn69KnIQg:1␤------> 3loop { last if7⏏5; }␤Whitespace required after keywo…»
AlexDaniel well, the full error message is here: gist.github.com/AlexDaniel/e796877f2f9121f00e3d 00:13
why does it repeat the same thing four times...
and then what, missing semicolon??
m: last if; 00:15
camelia rakudo-moar 97ebe4: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'if'␤at /tmp/9QKHPgdooe:1␤------> 3last if7⏏5;␤Whitespace required after keyword 'if'␤at /tmp/9QKHPgdooe:1␤------> 3last if7⏏5;␤Whitespace required after keyword 'if'␤at /tmp/…»
skids std: loop { last if; } 00:16
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Confused at /tmp/KVMIRjBWql line 1:␤------> 3loop { last 7⏏5if; }␤ expecting feed_separator␤Parse failed␤FAILED 00:00 136m␤»
AlexDaniel std: last if; 00:17
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Confused at /tmp/i3YZNRwtf6 line 1:␤------> 3last 7⏏5if;␤ expecting feed_separator␤Parse failed␤FAILED 00:00 135m␤»
AlexDaniel again, "confused" is better than "whitespace required" x 4 and "missing semicolon" :) 00:18
00:19 vendethiel left
AlexDaniel another similar issue is this: 00:20
m: repeat { } while;
camelia rakudo-moar 97ebe4: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'repeat { } while'␤at /tmp/Eanj3eUe7b:1␤------> 3repeat { } while7⏏5;␤Missing "while" or "until"␤at /tmp/Eanj3eUe7b:1␤------> 3repeat { } while7⏏5;␤ expecting any of:␤ …»
AlexDaniel or maybe it's not similar, I have no idea
it actually says "confused" with "unless"! :) 00:29
m: say 1 unless; 00:30
camelia rakudo-moar 97ebe4: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'unless'␤at /tmp/wbCz3kvXsp:1␤------> 3say 1 unless7⏏5;␤Whitespace required after keyword 'unless'␤at /tmp/wbCz3kvXsp:1␤------> 3say 1 unless7⏏5;␤Whitespace required after keywo…»
AlexDaniel std: my $x = 2; if ($x == (2|4|5|"hello"|42|3.14)) { say 1} 00:33
camelia std 28329a7: OUTPUT«ok 00:00 142m␤»
AlexDaniel m: my $x = 2; if ($x == (2|4|5|"hello"|42|3.14)) { say 1}
camelia rakudo-moar 97ebe4: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏hello' (indicated by ⏏)␤ in block <unit> at /tmp/zOK68D06z7:1␤␤»
AlexDaniel well, ok, it makes sense
but one of the examples here is wrong: en.wikibooks.org/wiki/Perl_6_Progr.../Junctions
and I'm not sure how to fix that because it seems like the author meant this to work 00:34
OH, it seems like it talks about perl5 00:37
ok then
skids Hrm. Well. I think it would be better to rewrite it with a different operator because it is not obvious whether that is 5 or 6. 00:41
AlexDaniel skids: or maybe just put a comment. Because, yeah, it confused me a little bit. 00:44
skids: will you do that?
00:46 leont left 00:55 vendethiel joined
AlexDaniel m: my %test; %test<> = 25; 01:13
camelia rakudo-moar 97ebe4: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/sfpaumGDdU:1␤␤»
AlexDaniel what does it mean? 01:14
01:15 muraiki left
AlexDaniel I thought it would be equivalent to %test{''}. It's okay if it's not, but what is this "odd number of elements" thing? 01:15
skids m: %test<>.perl.say 01:16
camelia rakudo-moar 97ebe4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DOwgomKmgc␤Variable '%test' is not declared␤at /tmp/DOwgomKmgc:1␤------> 3<BOL>7⏏5%test<>.perl.say␤»
01:16 rmgk_ joined, rmgk is now known as Guest69446, Guest69446 left, rmgk_ is now known as rmgk
skids m: my %test; %test<>.perl.say 01:17
camelia rakudo-moar 97ebe4: OUTPUT«{}<>␤»
01:17 vendethiel left
skids That might be a GLR problem. 01:17
Oh.
AlexDaniel oh? 01:18
skids m: my %test; %test<> = :a(3);
camelia ( no output )
ShimmerFairy m: my %a = 1,2,3,4; say %a.perl
camelia rakudo-moar 97ebe4: OUTPUT«{"1" => 2, "3" => 4}<>␤»
01:18 Hor|zon joined
ShimmerFairy m: my %a = 1,2,3; say %a.perl 01:18
camelia rakudo-moar 97ebe4: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/bzFbdOIg46:1␤␤»
skids That empty <> syntax will be going away IIRC.
ShimmerFairy ^ that's where you usually see that error
AlexDaniel skids: ok then 01:19
skids but... the error is there for %test{} as well. Probably should not be, rather behave however () = 25 is supposed to behave. 01:22
01:23 Hor|zon left
skids It is not the same as %test{""} in ether case. 01:23
AlexDaniel m: my %test; %test{} = :a(3); say %test<a>; 01:26
camelia rakudo-moar 97ebe4: OUTPUT«3␤»
AlexDaniel it looks like it is a feature, not a bug
or not 01:28
TimToady a Zen slice just returns the hash, so it's as if it weren't there 01:29
skids Shouldn't a zen slice return the hash *values*?
japhb m: my $a = 0; my $b := Proxy.new(FETCH => { say "FETCH"; $a }, STORE => -> $, $v { say "STORE"; $a = $v }); $b++; # Can this FETCH-heaviness be improved? 01:30
camelia rakudo-moar 97ebe4: OUTPUT«FETCH␤FETCH␤FETCH␤FETCH␤FETCH␤FETCH␤FETCH␤FETCH␤STORE␤»
japhb m: my $a = 0; my $b := Proxy.new(FETCH => { say "fetch"; $a }, STORE => -> $, $v { say "STORE"; $a = $v }); $b++; # Can this FETCH-heaviness be improved? # Just for readability 01:31
camelia rakudo-moar 97ebe4: OUTPUT«fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤fetch␤STORE␤»
skids ISTR it was worse a one point, so maybe?
japhb skids: Well, I suppose that's promising, but 8:1 is kinda brutal 01:32
01:33 atroxaper joined, bin_005_v left
japhb This combined with having a Proxy in front of an event-sourced object makes for a LOT of event replays. 01:33
01:34 bin_005_v joined 01:37 atroxaper left
TimToady no, slicing with * returns all the values, whereas a Zen slice is essentially 0-dimensional, not 1-dimensional 01:38
01:54 bin_005_v left 01:55 amurf joined 01:59 amurf left 02:06 Exodist left 02:07 gfldex left 02:09 Exodist joined 02:14 noganex_ joined 02:16 adu joined 02:18 noganex left 02:26 nebuchadnezzar left, nebuchadnezzar joined, kanl joined 02:27 vike left, aborazmeh joined, aborazmeh left, aborazmeh joined 02:28 vike joined 02:31 tinyblak joined 03:03 colomon left 03:07 Hor|zon joined 03:12 Hor|zon left 03:16 aborazmeh left 03:28 pecastro left 03:33 AlexDaniel left 03:41 nys left 04:09 tinyblak left 04:23 khw left 04:35 vendethiel joined 04:56 Hor|zon joined 04:58 tinyblak joined 04:59 vendethiel left, tinyblak_ joined, tinyblak left 05:00 Hor|zon left 05:06 atroxaper joined 05:11 atroxaper left 05:12 raiph left, bjz joined 05:18 kaare_ joined 05:26 lolisa joined 05:32 amurf joined 05:37 amurf left 05:43 Psyche^_ joined 05:47 Psyche^ left 05:54 Alina-malina joined 05:57 Peter_R left 05:59 Peter_R joined 06:11 firefish5000 joined 06:14 aindilis left, rurban joined 06:15 rurban1 joined 06:32 adu left 06:42 rurban left 06:45 Hor|zon joined 06:47 isBEKaml joined 06:48 RabidGravy joined
RabidGravy marnin! 06:48
06:50 Hor|zon left, rurban joined
kanl m: ( 3 <=> 5 ) but False 06:53
camelia rakudo-moar 97ebe4: OUTPUT«Method 'mixin' not found for invocant of class 'Perl6::Metamodel::EnumHOW'␤ in block <unit> at /tmp/Y6qkSTxCrf:1␤␤»
kanl m: +( 3 <=> 5 ) but False
camelia ( no output )
06:55 rurban left
dalek kudo-star-daily: f136d62 | coke++ | log/ (9 files):
today (automated commit)
07:01
rl6-roast-data: fa45248 | coke++ | / (9 files):
today (automated commit)
07:02 rurban joined
[Coke] back up to 1028 tickts 07:07
07:07 rurban left
[Coke] m: my @a = 42; try { @a.clone }; say "alive" 07:07
camelia rakudo-moar 97ebe4: OUTPUT«This type does not support elems␤ in block <unit> at /tmp/GLcvuSsdXl:1␤␤»
[Coke] m: my @a = 42; try { @a.clone; CATCH { default {} } }; say "alive" 07:08
camelia rakudo-moar 97ebe4: OUTPUT«alive␤»
07:08 skids left
[Coke] cd t/spec 07:09
07:15 rurban joined, darutoko joined
[Coke] m: my $σ0; 07:15
camelia ( no output )
07:18 daxim left
dalek kudo/nom: 5a6a672 | moritz++ | lib/Pod/To/Text.pm:
Pod::To::Text: Avoid concatenationg Nils

see github.com/perl6/doc/issues/92, kmetcalf++
07:29
07:37 virtualsue joined 07:44 daxim joined, ely-se joined
ely-se hi 07:44
moritz hi ely-se 07:45
ely-se haven't done anything with Perl 6 since ages :p 07:46
07:46 Hor|zon joined
moritz time to start again 07:48
ely-se yes!
07:51 Hor|zon left 07:52 lizmat left
ely-se p6: (1, 2, 3, (4, 5, 6)).map(*.perl).perl.say 07:52
camelia rakudo-moar 5a6a67: OUTPUT«("1", "2", "3", "(4, 5, 6)")␤»
ely-se p6: .perl.say for (1, 2, 3, (4, 5, 6))
camelia rakudo-moar 5a6a67: OUTPUT«1␤2␤3␤(4, 5, 6)␤»
ely-se I can love Perl 6 again! :D
07:52 lizmat joined 08:01 ShimmerFairy left 08:06 virtualsue_ joined, virtualsue left, virtualsue_ is now known as virtualsue 08:10 atroxaper joined 08:15 atroxaper left, ShimmerFairy joined 08:16 vendethiel joined 08:25 virtualsue left, virtualsue joined 08:26 diana_olhovik_ joined 08:27 lolisa left 08:44 RabidGravy left 08:55 FROGGS joined
FROGGS o/ 08:57
09:01 ely-se left
masak antenoon, #perl6 09:05
mst moin 09:09
vendethiel \o
09:10 amurf joined
dalek kudo/nom: 200c544 | lizmat++ | src/core/List.pm:
Handle :SINK properly
09:13
09:13 diana_olhovik_ left
dalek ast: ae69ea0 | lizmat++ | S32-array/splice.t:
Add some more natives and :SINK testing
09:14
09:14 amurf left 09:16 breinbaa1 joined
lizmat good *, #perl6! 09:16
yoleaux 10 Jul 2015 23:02Z <skids> lizmat: proceed resumes matching when clauses. Also that code is temporary and we'll just throw those once .assuming has burned it wrt ecosystem falout.
09:18 ely-se joined
lizmat afk again& 09:19
09:20 rurban1 left 09:21 mudguts joined
mudguts Good whatever, perl6 09:21
[TuxCM] 45.7/45.0
09:22 rurban1 joined
mudguts I was tinkering a bit with jnthn++'s nqp guts course and have a minor ops question... 09:23
09:23 rurban left
mudguts I'm sure the problem is not the code per se... (this is for exercises 4 & % (white basic php echo and friends) 09:24
..as it works whenever I use the REPL loop 09:25
whenever i want the thing to run on a file, I get Too many positionals passed; expected 0 arguments but got 1 at e3.php:1 (<ephemeral file>::0) 09:26
code is here: github.com/edumentab/rakudo-and-nq...cise-4.nqp
I'm trying this command: nqp-m php_ex5.nqp test3.php 09:27
If someone could simply download the code from that link and try the command and confirm the problem is not local to me, I would be grateful 09:28
test3.php has: echo "hello world" in it 09:30
ely-se needs semicolon
moritz mudguts: please try to run it with nqp-m --ll-exception 09:31
ely-se echo statements in PHP must be terminated by semicolons. also needs <?php otherwise the text will be printed
mudguts thanks ely-se but no cigar - this isn't real php: just playin... the grammar allows optional semi on last statement 09:33
ely-se ok :p
I don't smoke anyway so I don't mind.
mudguts moritz: no diff with $ nqp-m phpv5.nqp --ll-exception e3.php Too many positionals passed; expected 0 arguments but got 1 at e3.php:1 (<ephemeral file>::0)
hang on... 09:34
09:35 Hor|zon joined
mudguts nope: nqp-m --ll-exception phpv5.nqp e3.php 09:35
(same error) does it work everywhere else? 09:36
Anyone willing to try it? Simple: Download into file (say "php_ish.nqp") from this link: github.com/edumentab/rakudo-and-nq...cise-4.nqp 09:40
09:40 Hor|zon left
mudguts then: echo 'echo "hello world"' > ex3.php (to create a 1 line php program) 09:41
asumming you have rakudobrew, then: nqp-m php_ish.nqp e3.php 09:42
09:42 mtj_- joined
mudguts where as "cat e3.php | nqp-m php_ish.nqp" will work fine 09:42
masak "we in the JavaScript world have a higher tolerance for nonsense and dreck." -- "Discoverability is often cited as npm’s biggest flaw." -- medium.com/@Rich_Harris/small-modu...a532d65de4 -- sounds to me exactly like what people say about CPAN. 09:43
metacpan++ has really helped there, I think. but discoverability *is* really hard.
mudguts :-)
masak and 90% of everything truly is crap.
ely-se npm is wonderful except for one single thing which is that packages are all in the same namespace. 09:44
other than that it's absolutely the best package manager I've ever used
09:44 TEttinger left
mudguts .oO Did I typo nqp/npm ?? 09:45
masak no, I was just talking about something else entirely. 09:46
09:46 shmibs_ joined
ely-se I'd rate Maven №1 if it were faster 09:47
masak that's the first good thing I've heard anyone say of Maven, I think. 09:48
09:49 shmibs left
moritz could never get npm to work on Debian (with the pre-packaged npm, that is) 09:49
masak apparently you're supposed to install it using something called `nvm` these days. I don't even. 09:50
kanl m: sub foo { my $a = 'FOO'; return( +$a andthen $a orelse Nil ) } 09:51
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NaelvaRnVC␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/NaelvaRnVC:1␤------> 3sub foo { my $a = 'FOO'; return( +$a7⏏5 andthen $a orelse Nil ) }␤ expecting any o…»
kanl m: sub foo { my $a = 'FOO'; return ( +$a andthen $a orelse Nil ) }
camelia ( no output )
kanl why is the whitespace necessary? 09:52
09:52 spider-mario joined
masak kanl: because without the space there, the inside of the parens parses as an argument list. 09:53
kanl: and `+` does not parse in argument lists. 09:54
09:55 mudguts left
ShimmerFairy masak: 1) I thought it was because lack of whitespace made return look like a function call, and 2) seriously? How have I not run into that before? O_o 09:55
masak ShimmerFairy: return is a function call. 09:56
ShimmerFairy Huh, I thought it was just a keyword
masak m: sub foo { return("OH HAI") }; say foo 09:57
camelia rakudo-moar 200c54: OUTPUT«OH HAI␤»
masak nope. function.
kanl m: sub foo { my $a = '2'; return( +$a ) }
camelia ( no output )
masak m: say &return ~~ Callable
camelia rakudo-moar 200c54: OUTPUT«True␤»
kanl m: sub foo { my $a = '2'; return( +$a, +$a, +$a ) }
camelia ( no output )
ShimmerFairy masak: you should explain better, because what you said makes it sound like stuff like foobar(+@list) shouldn't work, which is obviously false. 09:58
09:58 rindolf joined
masak kanl: oh, sorry. it's not the '+' that's unparseable, apparently. 09:58
kanl: it's that `andthen` is so loose it can't work inside an argument list.
ely-se IMO such shenanigans indicate a flaw in the language design. 09:59
masak uh? `andthen` has precendence looser than comma. how do you envision that working inside an arglist, then?
ShimmerFairy Still feels like a design flaw for foobar($a andthen $b) to be treated as something that can't possibly have a correct interpretation 10:01
moritz why not use foobar($a && $b) ?
masak well, `andthen` *does* have slightly different semantics. 10:02
but it's still something I would never be tempted to use inside of an arglist.
kanl moritz: because +'FOO' produces a (Failure), so && won't work. 10:03
masak actually, I'll widen that and say I'm generally not tempted to use `andthen` inside an expression. that's not how I think of it, or how Perl 6 expected you to think of it.
ShimmerFairy moritz: yeah, I was thinking && and || would be better choices in this case, at a glance (or ?? !! , since I think that's what's being attempted)
ely-se what's the diff between && and andthen? is the former strict and the latter lazy like in Erlang?
masak kanl: sounds like `//` is for you, then.
ely-se: besides `andthen` being much looser in precedence, it also sets $_ to the lhs
ely-se: (NYI)
ShimmerFairy masak: sure, and I still don't understand andthen or orelse well enough to argue, I'm just saying foobar($a andthen $b) *looks* like it shouldn't fail the parser :) 10:04
ely-se masak: oh ok
ShimmerFairy the looser version of && is 'and', || -> or, and so on, IIRC
kanl moritz: that didn't occur to me, thanks :) 10:05
ely-se sometimes I think Perl 6 is feature creep and will collapse under its own weight 10:06
10:06 leont joined
masak ely-se: Perl 6 doesn't try to be minimal, for sure. 10:07
ab5tract_ m: sub foo { my @a = '2' xx 6; return( +@a, +@a, +@a ) }; say foo; # this isn't supposed to work? why? 10:10
camelia rakudo-moar 200c54: OUTPUT«6 6 6␤»
10:10 bjz left 10:11 tgt joined
masak ab5tract_: no, I was wrong about that. 10:11
ab5tract_ masak: phew :)
masak ab5tract_: it's `andthen` that fails, not `+`
10:11 gfldex joined 10:13 colomon joined
ab5tract_ m: constant BIGGENER = * * * * *; sub f(*@x) { ::BIGGENER(@x) }; say f(3,3,3) 10:15
camelia rakudo-moar 200c54: OUTPUT«Too few positionals passed; expected 3 arguments but got 1␤ in whatevercode at /tmp/_IRRCbWsU7:1␤ in sub f at /tmp/_IRRCbWsU7:1␤␤»
masak | 10:16
ab5tract_ no combination of 'flat @x', or [email@hidden.address] or anything else I have tried will make that work
masak m: constant BIGGENER = * * * * *; sub f(*@x) { BIGGENER(|@x) }; say f(3,3,3)
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VXZHAJuVIL␤Variable '&BIGGENER' is not declared␤at /tmp/VXZHAJuVIL:1␤------> 3tant BIGGENER = * * * * *; sub f(*@x) { 7⏏5BIGGENER(|@x) }; say f(3,3,3)␤»
ab5tract_ masak: oooo
masak m: constant BIGGENER = * * * * *; sub f(*@x) { ::BIGGENER(|@x) }; say f(3,3,3)
camelia rakudo-moar 200c54: OUTPUT«27␤»
ab5tract_ that works, thanks
masak m: constant &BIGGENER = * * * * *; sub f(*@x) { BIGGENER(|@x) }; say f(3,3,3)
camelia rakudo-moar 200c54: OUTPUT«27␤»
10:17 bjz joined
ab5tract_ but after the GLR, the @x will flatten automatically? 10:17
masak pshwaughml. 10:18
ab5tract_ masak: ah, nice! I should have realized that declaring the constant as a sub would be one way to obviate the compile-order issue
masak & means 'Callable', but yes. 10:19
ab5tract_ in fact, I hope not.. It would be great to pass @x around discretely. Otherwise we are kind of back in the same situation as p5, where you will need to itemize (in p5, reference) all your args anyway 10:20
masak: ah yes, an important distinction, it's true
masak m: constant &BIGGENER = * * * * *; say &BIGGENER ~~ Sub; say &BIGGENER.^name
camelia rakudo-moar 200c54: OUTPUT«False␤WhateverCode␤»
ab5tract_ yuo' 10:21
yup
but declaring it as Callable means that the compiler can parse the sub declaration even though BIGGENER hasn't gotten "fleshened" into a Callable yet
or, that's the way my hangover is leading me to see it, anyway ;) 10:22
10:22 geekosaur left, bjz left
masak it's more about namespaces. putting a & in the declaration means you can use the `ident()` syntax wihtout the & 10:23
10:23 geekosaur joined
masak not putting a & means you have to go look for it in the package, so :: 10:23
10:23 bjz joined
masak one way to understand that is to say that `ident()` is really syntactic sugar for `&ident()` 10:23
ab5tract_ masak: interesting, thanks 10:26
10:26 tgt left
ab5tract_ yeah, it's clear after poking that this is not WhateverCode specific :) 10:27
dalek ecs: 29284f1 | (Stéphane Payrard)++ | S99-glossary.pod:
PEG (as seen in S05)
10:32
10:43 virtualsue_ joined 10:45 virtualsue left, virtualsue_ is now known as virtualsue 10:47 telex left 10:48 telex joined 10:54 FROGGS left 10:55 FROGGS joined 11:02 tinyblak joined 11:04 ely-se left 11:05 diana_olhovik_ joined, tinyblak_ left 11:08 ely-se joined 11:17 Psyche^ joined 11:19 Psyche^_ left 11:21 Hor|zon joined 11:23 virtualsue left 11:26 Hor|zon left 11:29 TimToady left 11:30 TimToady joined 11:45 diana_olhovik_ left 11:46 atroxaper joined 11:51 atroxaper left
timotimo .tell skids moritz is keeping github.com/moritz/perl6-all-modules 11:55
yoleaux timotimo: I'll pass your message to skids.
12:09 Ven joined 12:15 pecastro joined 12:23 rindolf left 12:29 nys joined
ely-se botsnack 12:33
12:36 brrt joined 12:37 Hor|zon joined
moritz .botsnack 12:40
yoleaux :D
12:41 Hor|zon left
ely-se :( 12:43
12:47 amurf joined 12:52 amurf left 12:55 lucasb joined 13:05 espadrine_ joined
cognominal reading sources I wonder what is a typevar scope. Probably a scope for a type? 13:05
seems related to genericity 13:07
13:07 bjz left 13:10 bjz joined
[TuxCM] «self.foo(|%hash)» to invoke «method foo (*@f is copy) {» does not seem to work (anymore) 13:16
do I need a map with .kv or some such?
13:16 AlexDaniel joined
moritz [TuxCM]: self.foo(|%hash) interpolates %hash as named arguments 13:17
|%hash.list should work
m: my %h = a => 1; sub f(*@pos, *%named) { say @pos.perl, %named.perl }; f |%h; f |%h.list; 13:18
camelia rakudo-moar 200c54: OUTPUT«[]<>{:a(1)}<>␤[:a(1)]<>{}<>␤»
moritz hates the []<> notation
lucasb m: < ><><><><><><><><><><> # :D 13:19
camelia ( no output )
cognominal lucasb: is this intended as proof of Perl 6 seminality? 13:22
lucasb cognominal: just kidding :) 13:23
13:23 aborazmeh joined, aborazmeh left, aborazmeh joined 13:35 brrt left 13:38 mohij joined 13:42 tinyblak left, aborazmeh left, raiph joined
timotimo cognominal: typevars are scoped to roles, for example 13:52
if you have role Foo[T] { ... } then inside { } the T is scoped
cognominal that now makes sense to me, timotimo++ 13:55
timotimo it's an optimization; it can be treated as if it were lexical
lucasb An interesting thing to me is that, iirc, Python and Ruby use * and ** both to pack and unpack arrays/hashs in method definitions/calls and assignments. P6 uses *@a and *%h in sub definitions to "pack" the incoming args, but uses prefix:<|> to unpack them in sub calls. But differently, it also uses (|c) to capture a Capture in sub definitions. 13:57
I'm just saying how I currently understand things, please correct if I'm wrong. Any plans in the future for prefix:<|> also work outside arglists? I guess this relates very strongly with the flattening/non-flattening contexts, after all the "|" operator can be seen as flattening thing, can't it?
14:01 firefish5000 left
[TuxCM] is there *any* way that I can check if a method is called in void context? 14:07
14:08 ely-se left
timotimo you can see if the value you return gets .sink called on it 14:08
[TuxCM] how? 14:09
the method can return a lot of different things
timotimo you can mix in a role for that 14:10
return $value but role { method sink { say "aha! void context!" } }
[TuxCM] that wont, work for me, as I need to change something halfway the method if called in void context 14:12
method foo () { my $x = 0; ...... ; if (void) { $x++; } ... ; return something; } 14:13
timotimo i don't think it's possible. we have a few places in core where we've changed the code-gen to supply SINK => True, but strictly only for optimizations 14:14
14:15 silug left
vendethiel [TuxCM]: sorry, but: "why?" 14:15
14:16 rindolf joined
[TuxCM] the default for the $out attribute of this method is depending on the combination of all other attributes 14:16
and in two cases, the default should be to use $*OUT instead of returning a value 14:17
and those two cases are only true in void context
vendethiel [TuxCM]: sounds like DWIM gone awry to me :(
[TuxCM] so «foo (...., out =>$*OUT);» can be written as «foo (...);» 14:18
vendethiel m: my $*foo = 1; say :$*foo;
camelia rakudo-moar 200c54: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at /tmp/JJnsa6KSBu:1␤␤»
vendethiel m: my $*foo = 1; say (:$*foo);
camelia rakudo-moar 200c54: OUTPUT«foo => 1␤»
[TuxCM] whereas «my $foo = self.foo (..., out => $*OUT);» makes no sense
14:18 tinyblak joined
vendethiel [TuxCM]: well, first off, you can write that foo(:$*OUT); :P (but you'll need to be careful at that OUT/out, I guess :(.) 14:19
[TuxCM] out can be a filename or a supply
or Hash (return content as Hash) or Array (return content as Array) 14:20
14:22 khw joined, grondilu joined
grondilu I'm wrinting P5 code and I miss so many things. 14:22
(from P6 I mean) 14:23
for instance I'm wondering what's the best equivalent of a Pair in P5
I could use [$pair, $value] but meh 14:24
14:24 rurban1 left
[TuxCM] pack 14:24
grondilu earlier I meant [$key, $value] of course
14:25 firefish5000 joined 14:26 Hor|zon joined
[TuxCM] sub foo (Int $i) { $i - 1; }; $class.bar (foo => &foo); # works great 14:27
$class.bar (foo => sub (Int $i) { $i - 1; }); # Unable to parse expression in argument list; couldn't find final ')' 14:28
can I pass an anonymous sub with a signature?
14:29 silug joined 14:31 Hor|zon left
vendethiel [TuxCM]: the issue is "$class.bar" 14:31
bar 1; is okay, but for methods, it's $class.bar: 1;
[TuxCM] doesn't get it 14:32
moritz m: class A { method bar(:&foo) { foo 42 } }; A.bar( foo => sub (Int $i ) { $i - 1 } ); 14:33
camelia ( no output )
vendethiel m: class A{ method f($n) { $n }}; my A $a .= new; $a.f 1; # doesn't parse
moritz works fine.
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BA5FEYNVQv␤Two terms in a row␤at /tmp/BA5FEYNVQv:1␤------> 3thod f($n) { $n }}; my A $a .= new; $a.f7⏏5 1; # doesn't parse␤ expecting any of:␤ infix␤ infix stopper␤ s…»
[TuxCM] gist.github.com/Tux/d7f5afd66fea7eecc686
vendethiel m: class A{ method f($n) { $n }}; my A $a .= new; $a.f: 1; # with the colon, does parse
camelia ( no output )
moritz $r<legs > 70; 14:34
vendethiel [TuxCM]: ^
moritz looks wrong
$r.legs > 70?
or $r<leg> > 70 ?
[TuxCM] $r<legs> > 70 14:35
moritz also, when debugging syntax errors, try without Slang::Tuxic
[TuxCM] but that doesn't change
and with or without the lone $ it keeps failing to parse
vendethiel m: sub $ ($){};#wut lone $ as a name? 14:36
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MyefbDuP2e␤Missing block␤at /tmp/MyefbDuP2e:1␤------> 3sub7⏏5 $ ($){};#wut lone $ as a name?␤ expecting any of:␤ new name to be defined␤»
vendethiel [TuxCM]: I think you should fix those two (the "sub $" and the $<legs >")
moritz m: sub ($) { }; # should work
camelia ( no output )
vendethiel moritz: " filter => sub $ (CSV::Row $r) {" 14:37
moritz vendethiel: yes
14:37 amurf joined
vendethiel that's obviously wrong 14:37
[TuxCM] I fixed both (I think) : gist.github.com/Tux/0e429983a6dd84f87ef3 14:38
14:39 skids joined
vendethiel m: sub f(&){}; f (x => sub (Int $){$<foo> > 5;}) 14:39
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NtTtVlbThl␤Calling f(Pair) will never work with declared signature (&)␤at /tmp/NtTtVlbThl:1␤------> 3sub f(&){}; 7⏏5f (x => sub (Int $){$<foo> > 5;})␤»
vendethiel m: sub f(Pair){}; f (x => sub (Int $){$<foo> > 5;})
camelia ( no output )
vendethiel m: module A {class B {}}; sub f(Pair){}; f (x => sub (A::B $){5;}) 14:40
camelia ( no output )
lizmat good *, #perl6!
vendethiel o/, lizmat!
[TuxCM] o/ lizmat
lizmat m: my $s = Supply.new; $s.emit($_) for ^10; .print for gather $s.act: { take $_ } # how does the gather know that the supply is done? 14:41
camelia rakudo-moar 200c54: OUTPUT«0123456789»
lizmat I would expect this to hang, or not print anything
vendethiel m: module A {class W {}}; sub f(Pair){}; f (x => sub (A::W $r){5;})
camelia ( no output )
14:41 amurf left
vendethiel m: module CSV {class Row {}}; sub csv(*%){}; csv (in => "legs.csv", out => $*OUT, headers => "auto", filter => sub (CSV::Row $r) { $r<legs> > 70; }); 14:42
camelia rakudo-moar 200c54: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub csv at /tmp/FKpit4EAge:1␤ in block <unit> at /tmp/FKpit4EAge:1␤␤»
vendethiel m: module CSV {class Row {}}; sub csv(@){}; csv (in => "legs.csv", out => $*OUT, headers => "auto", filter => sub (CSV::Row $r) { $r<legs> > 70; });
camelia ( no output )
vendethiel I might blame Slang::Tuxic :) 14:43
lizmat hmmm... I figured it out, I think
[TuxCM] damn. that didn't even spring to mind as a possibility
lizmat it's the buffering before first tap :-( 14:44
[TuxCM] vendethiel, « filter => sub f (CSV::Row $r) { » works fine 14:45
(add the singe f)
vendethiel [TuxCM]: I guess you can use "sub ::"
moritz or 'anon sub f' 14:46
vendethiel doesn't like to name anonymous things :)
moritz very handy for when you introspect the anon thing 14:47
[TuxCM] both alternatives work fine! (anon sub f and sub ::)
14:47 isBEKaml left
vendethiel oooh, I get it. 14:48
m: sub();
camelia rakudo-moar 200c54: OUTPUT«5===SORRY!5=== Error while compiling /tmp/O0KBg8Zcq1␤Undeclared routine:␤ sub used at line 1␤␤»
vendethiel right. and here, slang::tuxic sees the space and thinks "hey, I'm right here to handle that call!"
FROGGS: ^. I think that's the only perl6 construct that goes "(){}"? 14:50
lucasb use Slang::Tuxic; sub (Int $x) {} #=> Unable to parse expression in argument list; couldn't find final ')' 14:55
vendethiel found the culprit! :P
[TuxCM] and now the fix :) 14:58
15:21 skids left 15:22 atroxaper joined 15:27 atroxaper left 15:30 RabidGravy joined
FROGGS we just need to specialcase 'sub' 16:06
TimToady
.oO(lists of exceptions, where have I heard that before...)
16:07
FROGGS ohh, we do not specialcase keywords at all yet :/ 16:08
TimToady: :P
I'm only the maker, not a user of Slang::Tuxic :o)
TimToady it's officially okay to extend Perl 6 into a non-extensible language :P 16:10
16:11 domidumont joined 16:12 Hor|zon joined
FROGGS every modification to Perl 6 in user space if of course one step in the direction of non-perfectness :o) 16:12
jnthn i can haz messages? 16:13
...nope!
FROGGS :P
jnthn From backlog: I think we need some kind of type representing strings from the file system, environment, etc. 16:14
FROGGS O.o
what should it do? guess the encoding? 16:15
(I've not backlogged)
jnthn Be byte-based and preserve the exact value, and offer coercion to Str that could guess...
FROGGS ahh
yeah 16:16
jnthn But I guess it might have to be viral
16:16 domidumont left, domidumont joined
jnthn Since if you do $str-from-file-system ~ '.bak' then we know the '.bak' bit is safe, but the other bit may not be 16:16
16:16 Hor|zon left
jnthn Anyway, guess it needs some pondering/prototyping 16:17
TimToady kinda related to the notion of tainting as well 16:20
and possibly to detecting DoS attacks on NFG 16:21
assuming the viral strings track their source 16:22
vendethiel jnthn: maybe tainting as well? 16:23
oh my... whoops...
TimToady :)
at least you highlit him
vendethiel
.oO( Look at me, I can backlog! Wait, there's more? )
jnthn Has taining been an actual success story in Perl 5? I don't really see/hear about it much. 16:24
It was certainly in the "stuff I was figuring could go to module space"... 16:25
vendethiel only learned about tainting from his perl book
TimToady well, people tend not to blame the language when there's an injection attack, even if they should
jnthn True, though I'd have thought providing quoting slangs that can follow the target language's syntax rules might be a more promising approach... 16:26
vendethiel say no to string programming :P 16:27
ShimmerFairy
.oO(Then why do I keep hearing complaints about PHP? :P)
vendethiel oh, fglock has been adding java support to perlito5. interesting
.oO( "Java is not the enemy" - said someone from the Perl community around year 2000 )
16:28
leont Tainting is a secutity-in-depth feature 16:29
security even
If you need it you already have a bug, but it can often prevent those bugs
It would probably be better if you could specify what to protect against, the environmental protections (e.g having to explicitly set PATH to run system) don't make sense on a webserver, for example 16:30
16:31 smls joined
smls o/ 16:31
16:32 dustinm` left 16:34 dustinm` joined
smls Remind me: What do I have to write instead of :16<ff> if I have "ff" in a variable? 16:39
perl -E 'say hex("ff")' # can only remember the Perl 5 version
:16«$n» and :16($n) don't work 16:40
TimToady m: my $n = "ff"; say :16($n) 16:41
camelia rakudo-moar 200c54: OUTPUT«255␤»
TimToady in what sense does that not work?
smls huh
in the sense that I must have made a mistake when testing it :P 16:42
TimToady guesses you tryied passing 0xff instead
*tried
m: my $n = 0xff; say :16($n)
camelia rakudo-moar 200c54: OUTPUT«You have confused the number 255 with the textual representation "255";␤if you wanted to render the number in the given base, use $number.base($radix)␤ in block <unit> at /tmp/0o6cHIELj7:1␤␤»
smls m: say :16(20) # ah, it doesn't work with literals
camelia rakudo-moar 200c54: OUTPUT«You have confused the number 20 with the textual representation "20";␤if you wanted to render the number in the given base, use $number.base($radix)␤ in block <unit> at /tmp/eQ72q5oiCm:1␤␤»
TimToady those error messsage aren't quite awesome yet 16:43
smls and it only accept strings, not numbers 16:44
TimToady in the first case, there is no textual representation "255"
in the second, it guesses the wrong desired semantics
16:52 firefish5000 left
dalek kudo/nom: 58a5edf | TimToady++ | src/core/ (2 files):
improve message for :16($number) et al.
17:19
17:25 haroldwu left 17:27 haroldwu joined 17:28 tinyblak left 17:33 domidumont left
dalek ast: 6dd7403 | TimToady++ | S02-literals/radix.t:
X::Numeric::Confused object changes
17:42
TimToady m: my $n = 0xff; say :16($n) 17:51
camelia rakudo-moar 58a5ed: OUTPUT«This call only converts base-16 strings to numbers; value 255 is of type Int, so cannot be converted!␤(If you really wanted to convert 255 to a base-16 string, use 255.base(16) instead.)␤ in block <unit> at /tmp/s6os10TUWD:1␤␤»
17:54 diana_olhovik_ joined
[TuxCM] FROGGS, remember that without Slang::Tuxic I would not have been able to get you all my bugs :P 17:59
18:01 Hor|zon joined 18:05 Hor|zon left 18:11 smls_ joined 18:12 smls left 18:14 amurf joined 18:15 smls_ left 18:19 amurf left 18:21 diana_olhovik_ left
FROGGS [TuxCM]: I do not deny that it solves some needs, I'm just saying that it introduces tradeoffs where clean rules are in place :o) 18:25
[TuxCM] FWIW, in this case leaving the space *out* when not using S::T, it also fails:
$ p6 -MText::CSV -e'csv(in=>"legs.csv",out=>$*OUT,headers=>"auto",filter=>sub($r){$r<legs> >6})'
===SORRY!=== Error while compiling -e
Undeclared routine:
sub used at line 1
$ p6 -MText::CSV -e'csv(in=>"legs.csv",out=>$*OUT,headers=>"auto",filter=>sub ($r){$r<legs> >6})'
works as expected 18:26
FROGGS which is correct in both cases
[TuxCM] this is why I want Slang::Tuxic. NO confusion anymore for me! 18:27
FROGGS now I remember... I tried special casing some keywords... and failed
github.com/FROGGS/p6-Slang-Tuxic/c...39b5f7e1dc 18:28
18:29 tinyblak joined
[TuxCM] now I also remember 18:31
18:33 berekuk joined, berekuk left, tinyblak left 18:36 kurahaupo joined 18:42 domidumont joined
FROGGS [TuxCM]: can you try latest Slang::Tuxic when you get the chance? 18:49
masak [TuxCM]++ # knowing what he wants
FROGGS++ # being helpful and accommodating
[TuxCM] FROGS++
vendethiel FROGGS++ :) 18:50
[TuxCM] (all p6 folk)++
FROGGS :o)
[TuxCM] never giving up on me :)
FROGGS hehe
masak [TuxCM]: I remember half a handful of discussions with you acress the years about whitespace. I'm really happy they turned into Slang::Tuxic 18:51
[TuxCM] FROGGS, Text::CSV still passes 18:53
FROGGS \o/ 18:55
cognominal github.com/rakudo/rakudo/pull/466 A pull request 18:57
[TuxCM] filter => sub (CSV::Row $r) {
also works
FROGGS++; # just for good measure 18:58
(talk slide adjusted)
masak waitwait, so the conclusion is that even Slang::Tuxic requires whitespace after `sub` ?
cognominal *++ # Whoever for good measure 18:59
18:59 atroxaper joined 19:03 atroxaper left 19:04 ShimmerFairy left
lucasb I would appreciate if someone could take a look at why $/ is not getting bound in the replacement side of s/// inside for. Thanks. 19:04
m: 'a'.subst(/a/, { say $/.WHAT })
camelia rakudo-moar 58a5ed: OUTPUT«(Match)␤»
lucasb m: for 1 { 'a'.subst(/a/, { say $/.WHAT }) } 19:05
camelia rakudo-moar 58a5ed: OUTPUT«Nil␤»
19:05 ShimmerFairy joined
lucasb Same thing happens inside gather too; idk what's the interaction between for/gather and .subst 19:05
19:06 davido__ left
masak m: say $/.WHAT 19:06
camelia rakudo-moar 58a5ed: OUTPUT«Nil␤»
masak m: 'a'.subst(/a/, -> $/ { say $/.WHAT })
camelia rakudo-moar 58a5ed: OUTPUT«(Match)␤»
masak m: for 1 { 'a'.subst(/a/, -> $/ { say $/.WHAT }) } 19:07
camelia rakudo-moar 58a5ed: OUTPUT«(Match)␤»
19:07 davido__ joined
dalek ast: 4c85334 | TimToady++ | S02-literals/radix.t:
tests for colon-form radix overrides
19:07
masak lucasb: you have to pass $/ as aparameter to the block.
dalek kudo/nom: 24030f9 | TimToady++ | src/core/Str.pm:
allow :16(':8<377>') and such
masak lucasb: I don't know why `'a'.subst(/a/, { say $/.WHAT })` (your first eval) still works. 19:08
lucasb masak++, thanks
thing is, I found this trying something like s/(\d+)/$0/ 19:09
masak that oughta work.
lucasb It doesn't :(
masak m: $_ = "OH 819"; s:g/(\d)/{chr(64 + $0)}/; .say 19:11
camelia rakudo-moar 58a5ed: OUTPUT«OH HAI␤»
masak worksforme
japhb m: role A { method !foo { say "success!" } }; role B { method bar { self!foo } }; class C does A does B { }; C.
camelia rakudo-moar 58a5ed: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HApnTj8iPB␤Confused␤at /tmp/HApnTj8iPB:1␤------> 3f!foo } }; class C does A does B { }; C.7⏏5<EOL>␤»
japhb m: role A { method !foo { say "success!" } }; role B { method bar { self!foo } }; class C does A does B { }; C.new.bar();
camelia rakudo-moar 58a5ed: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EYwA0Na4Nq␤No such private method 'foo' for invocant of type 'B'␤at /tmp/EYwA0Na4Nq:1␤------> 3ccess!" } }; role B { method bar { self!7⏏5foo } }; class C does A does B { }; C.ne␤»
japhb m: role A { method !foo { say "success!" } }; role B { method !foo { ... }; method bar { self!foo } }; class C does A does B { }; C.new.bar(); 19:12
camelia rakudo-moar 58a5ed: OUTPUT«===SORRY!===␤Private method 'foo' must be resolved by class C because it exists in multiple roles (B, A)␤»
japhb Is there any reason that one of the two above can't be made to work?
(Personally I think the last one should DWIM.)
masak japhb: I guess it comes down to how private methods from a role compose into a class. 19:13
lucasb m: my $x = 'a1'; $x ~~ s/(\d+)/<$0>/; say $x
camelia rakudo-moar 58a5ed: OUTPUT«a<1>␤»
lucasb m: for 1 { my $x = 'a1'; $x ~~ s/(\d+)/<$0>/; say $x }
camelia rakudo-moar 58a5ed: OUTPUT«Use of Nil in string context in code at /tmp/SOTPBUyxHF:1␤a<>␤»
masak submits rakudobug 19:14
lucasb: clearly that should work. thanks for finding it.
japhb masak: Sure ... but methinks a role ought to be able to specify that it requires definition of a private method, since the private methods are collapsed into the class.
TimToady various supply tests are randomly hanging for me when run in parallel
japhb TimToady: Any opinion on the roles-requiring-private-methods thing I posted above? 19:15
masak m: for 1 { $_ = "OH 819"; s:g/(\d)/{chr(64 + $0)}/; .say } 19:16
camelia rakudo-moar 58a5ed: OUTPUT«Cannot assign to an immutable value␤ in block <unit> at /tmp/i9vL27ky5d:1␤␤»
masak m: my $s = "OH 819"; for $s { s:g/(\d)/{chr(64 + $0)}/; .say } 19:17
camelia rakudo-moar 58a5ed: OUTPUT«Use of Nil in numeric context in block at /tmp/4I0l1xSFeV:1␤Use of Nil in numeric context in block at /tmp/4I0l1xSFeV:1␤Use of Nil in numeric context in block at /tmp/4I0l1xSFeV:1␤OH @@@␤»
masak m: my $s = "OH 819"; $s ~~ s:g/(\d)/{chr(64 + $0)}/; say $s
camelia rakudo-moar 58a5ed: OUTPUT«OH HAI␤»
19:18 bin_005 joined
dalek kudo/nom: fff5f55 | (Stéphane Payrard)++ | src/Perl6/Actions.nqp:
simplify convolutated code with duplicate statement
19:19
kudo/nom: 81d1738 | lizmat++ | src/Perl6/Actions.nqp:
Merge pull request #466 from cognominal/variable_declarator

simplify convoluted code with duplicate statement
lizmat TimToady: I've seen that happen, but it only happens on "bad" builds 19:20
without clarity what makes a build "bad" or "good" 19:21
TimToady m: my $n = ':8<377>'; say :16($n)
camelia rakudo-moar 24030f: OUTPUT«255␤»
cognominal sometimes I use "convolutated" adjectives :(
TimToady this is after a make clean; trying again without TEST_JOBS to see if it's just the test harness (individual tests run fine) 19:22
cognominal lizmat++ for merging cosmetic patches
lizmat TimToady: make clean doesn't make a difference to me *if* it is a "bad" build 19:23
cognominal++ # those are the easiest ones to merge :-)
[TuxCM] tux.nl/Talks/CSV6/hooks6.html :)
lucasb I see that Str.APPLY-MATCHES has this line: noargs ?? $replacement() !! $replacement($m) 19:25
So using $/ as a parameter helped. I was justing expecting $/ to be bound automatically 19:26
thanks for submitting the rakudobug, masak++ 19:27
masak my pleasure. 19:28
19:30 domidumont left 19:31 diana_olhovik joined
TimToady japhb: I suspect both submethods and !methods should be considered private to the role, though with different linkage to the class 19:31
submethods like BUILD should automatically be called along with the class's BUILD, while private methods should probably require explicit qualification if there's more than one 19:32
but we'd need to get jnthn's opionion wrt feasibility 19:33
opi-onions, yum!
FROGGS opiumions? 19:34
TimToady on supply hangs, got one without TEST_JOBS too 19:35
japhb Hmmm, I didn't actually test the case of explicitly specifying the source role ....
m: role A { method !foo { say "success!" } }; role B { method bar { self!A::foo } }; class C does A does B { }; C.new.bar();
camelia rakudo-moar 24030f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/n0d8A7PJKM␤Cannot call private method 'foo' on package A because it does not trust B␤at /tmp/n0d8A7PJKM:1␤------> 3" } }; role B { method bar { self!A::foo7⏏5 } }; class C does A does B { }; C.new.b…»
japhb Hmmm, methinks roles composed in the same class should trust each other. 19:36
Although this way lies tighter linkage between roles than making it work to just require that a private method exists. 19:37
masak by the way, xkcd.com/1542/ was an autopun
japhb I think I'd rather have the require-a-private-method technique. Because I'd like a role to depend on *some* other role that matches a given interface, not *one particular* role. 19:38
And it doesn't feel right to make a method (or attribute) public *just* to allow roles to work together that way. 19:39
FROGGS [TuxCM]: in latest Slang::Tuxic you can declare that hook as "sub(){}"
masak japhb: an argument could also be made that since private attrs compose, private methods ought also. 19:40
FROGGS++
japhb masak: Yes, that.
lizmat [TuxCM]: gist.github.com/lizmat/b794f31b9d5978e76886
[TuxCM] OMG
what is $^ex? 19:41
masak implicit parameter
lizmat { $^a } is the same as -> $a { $a }
masak same as -> $ex { c.quit($ex) }
lizmat another way to create signatures 19:42
masak implicit parameters are nifty. they declare themselves implicitly in Unicode sorting order.
19:42 raiph left
masak m: my $b = { say "$^second $^first" }; $b("HAI", "OH") 19:43
camelia rakudo-moar 24030f: OUTPUT«OH HAI␤»
[TuxCM] now that I made a (big) step into actually doing the filter callbacks right, I might find motivation to do more
masak m: { say "$^second $^first" }("HAI", "OH")
camelia rakudo-moar 24030f: OUTPUT«OH HAI␤»
[TuxCM] my YAPC::EU talk made me jump the hurdle
lizmat [TuxCM]: especially when creating callbacks, implicit parameters make things a lot easier to specify 19:44
-> $a, $b, $c { $a * $b * $c } becomes { $^a * $^b * $^c }
[TuxCM] filter => sub { $^r<legs> > 3 }
lizmat yup
[TuxCM] I get it. I like it 19:45
lizmat even without the sub
filter => { $^r<legs> > 3 }
[TuxCM] WHAT? awesome!
[TuxCM] changes the slide again
masak if you remove `sub`, you can't say `return` inside, though.
lizmat you can only "leave", but that is NYI indeed
masak I thought about `leave` the other day, and why it's still NYI. should we be concerned about that? 19:46
it's a fairly central feature.
ISTR Niecza implements it.
lizmat well, if it's easily circumventable by adding "sub" and use return
masak not always.
lizmat I'm not quite sure why we need it, tbh
[TuxCM] tux.nl/Talks/CSV6/hooks6.html :) 19:47
masak what if I actually have a block with a label, then a lot of deep nesting, and then `leave LABEL;` far inside.
lizmat ah, isn't that just goto LABEL though ? 19:48
19:48 bin_005_j joined, ][Sno][ joined
masak it is goto something after the end of that block, yes. 19:48
[TuxCM] Hmm. I have to support it though, as => { … } is neither Routine nor Sub
lizmat [TuxCM]: it's a Callable 19:49
masak lizmat: another thing that `goto` does not emulate is the fact that `leave` (like `return`) can pass a value.
lizmat ah, true, but how would the leave LABLE process the value then?
*LABEL 19:50
FROGGS masak: without that 'value' it should not even be that hard to implement I think
19:50 Hor|zon joined, [Sno] left
[TuxCM] thanks, Callable works 19:50
masak FROGGS: that's what confuses/worries me. why don't we have it already?
FROGGS lizmat: it would be part of the thrown control exception
masak: I dunno... time?
lizmat it needs work at the nqp level, afaik
or even VM level? 19:51
19:51 bin_005 left
masak .oO( it needs to work on the level of the physical substrate ) o.O 19:51
[TuxCM] I'll stop, before it will turn into a late night :) 19:52
Thanks all for all the valuable feedback today!
FROGGS gnight [TuxCM]
masak [TuxCM]: 'night
19:55 Hor|zon left
lizmat gnight [TuxCM] 19:55
.tell [TuxCM] the semicolon in $^r<legs> < 8; is not needed 19:56
yoleaux lizmat: I'll pass your message to [TuxCM].
20:02 firefish5000 joined 20:07 telex left 20:08 telex joined 20:11 kurahaupo left 20:25 everym4n joined, kurahaupo joined 20:27 virtualsue joined, kaare_ left 20:30 kurahaupo left 20:31 darutoko left 20:32 kurahaupo joined 20:35 diana_olhovik left 20:37 Ven left 20:40 kurahaupo left 20:42 everym4n left 20:44 haroldwu left 20:46 dylanwh left
TimToady lizmat++, forcing a recompile of MoarVM and nqp seems to have cleared the hangs 20:47
AlexDaniel FROGGS: Hi! Have you thought about this "run" vs "qqx//" problem? 20:49
$output = run(«echo $test», :out).out.get; 20:50
$output = qqx/echo $test/;
FROGGS AlexDaniel: what was it? seems I forgot
AlexDaniel Huffmanly speaking qqx is better, but it should not be
FROGGS ahh, that one
AlexDaniel yea 20:51
FROGGS had thought about it the other day, but had no idea how to improve it
20:51 haroldwu joined
FROGGS hmmm 20:52
AlexDaniel I think that it is important to fix it. Maybe someone else can suggest something? 20:53
FROGGS .oO( sub echo (*@) is system-command { * }; echo $test )
surely, everybody can suggest something
AlexDaniel it is a bit too extreme, but maybe getting rid of qqx would help... 20:54
I mean, sure you can have it, but why is it so short 20:55
masak wait, why get rid of it because it's short? 20:57
AlexDaniel masak: well, if it is so short, then everybody is going to use it because it "looks right" unlike "run" 20:58
masak AlexDaniel: I use `run` when I want the side effect and `qqx` when I want the output. 20:59
AlexDaniel masak: but then you get all sorts of the problems because you pass stuff to the shell, which should be avoided
masak: well, you've just confirmed the problem
masak I'm sorry, I still don't see the problem. "all sorts of the problems" doesn't quite do it for me as an explanation. 21:00
I've successfully used `qqx` a bunch of times.
AlexDaniel masak: ok, well, when you pass stuff to the shell you have to quote parameters
masak: but why bother with that when you can just skip the shell?
especially when you don't need it 21:01
21:01 dylanwh joined
AlexDaniel there was another discussion on that topic: irclog.perlgeek.de/perl6/2015-06-27#i_10813919 but it started with a wrong question 21:01
masak I think I could track down all my uses of qqx ever, and prove formally that they don't have shell quoting problems.
even if they did, those problems did not manifest for me when I ran the stuff. 21:02
AlexDaniel masak: good for you, but not that good for the language itself
japhb .ask jnthn What are your thoughts on irclog.perlgeek.de/perl6/2015-07-11#i_10881267 and irclog.perlgeek.de/perl6/2015-07-11#i_10881334 ? Having no good resolution kinda gets in the way of a nice refactoring (for now, I'm copying the required private methods into each role that would want to consume them, and then changing the names to not collide between the roles which is ... blech.)
yoleaux japhb: I'll pass your message to jnthn.
AlexDaniel masak: well, you know, most people don't quote their variables in bash because "it works" 21:03
masak *nod*
I'm usually not on this side of arguments like these :>
AlexDaniel and then you pass a filename with a space or some other special stuff and the whole thing just breaks
masak I like works-always as a principle too.
it *does* feel a little bit like the SQL quoting slangs we've been talking about now and then. 21:04
AlexDaniel yea
masak that is, you just want to interpolate the variable in some nice slang, and it quotes things for you automatically and in the right way.
21:04 dylanwh left
FROGGS masak: we dont have to quote things at all when we use run() 21:05
AlexDaniel and if I get it right, that's what this Huffman coding thing is about - correct stuff should be easier than other insecure ways
masak FROGGS: oh right, `run()` already does this 21:06
AlexDaniel nope
it does not quote anything, if I get it right
FROGGS correct, it stays an array
masak I think someone prototyping this slang in module-space would be awesome. then we could discuss how core it should be, and whether it should replace `qqx`
21:07 rindolf left
AlexDaniel well, look: $output = run(«echo $test», :out).out.get; 21:08
it is already there, just a bit too hard to type and remember...
I really think that running stuff in shell should be discouraged. At first I thought "but how do you pipe stuff then?" but then I read this: doc.perl6.org/type/Proc 21:10
japhb AlexDaniel, masak, FROGGS: Why not just have something (just slightly more complex than) 'multi sub QX($cmd, @*args) { run($cmd, |@args, :out).out.get }' and call it a day? 21:11
(Apologies if someone already said this, I've only been skimming today.) 21:12
lucasb ftr, iiuc, .get only gets the first line; if someone wants the whole shebang, he would have to type even more: .slurp-rest :) 21:13
AlexDaniel japhb: ok, then what would be the replacement for qqx// ? In other words, to run a string in shell and get the output
lucasb: oh noes!
masak lucasb: just .slurp should work, too
japhb lucasb: Point taken.
lucasb masak: hmm?
.slurp-rest from IO::Handle 21:14
masak well, .slurp-rest is for when you've already started reading something and want to read the remainder.
if you're still at the beginning of the something, you can .slurp
japhb AlexDaniel: Since qqx// is IIRC implemented in terms of QX, I suspect something could be arranged; perhaps a named argument to QX that chooses the shell-ish behavior. Thats why I said "just slightly more complex than". It's all about the layers of sugar. 21:16
AlexDaniel uhh
21:16 bin_005_j_j joined
masak japhb: problem is that once you've flattened everything into a string, it's too late 21:16
21:17 virtualsue_ joined, bin_005_j left
japhb masak: This is perhaps the place where skimming is biting me. Why would you *want* to invoke the shell, if you don't want shellish behavior? 21:17
FROGGS gnight #perl6 (will backlog tomorrow)
21:17 FROGGS left
AlexDaniel japhb: because nobody wants shellish behavior 21:18
most of the time people just want to run the command
lucasb masak: .slurp from IO::Handle is deprecated; one has to use .slurp-rest even for the first time reading
AlexDaniel without all that shell stuff
masak japhb: the trap AlexDaniel wants to avoid is a single interpolated variable expanding into multiple shell args.
japhb: which is at best an annoyance and at worst a security issue.
japhb This is what I'm confused by: 14:13 < AlexDaniel> japhb: ok, then what would be the replacement for qqx// ? In other words, to run a string in shell and get the output
21:18 virtualsue__ joined
japhb masak: I know that. 21:18
AlexDaniel masak: not only. Imagine a filename like "$(rm -rf *)". 21:19
masak AlexDaniel: ah, good point.
AlexDaniel or just "*"
lizmat masak: .slurp works on a path, .slurp-rest on an opened handle
masak I can't claim I see the whole picture here either.
lizmat: ah.
21:19 virtualsue left
lucasb Which leads me to another question: Why did you people renamed IO::Handle.slurp to .slurp-rest? Just so that it doesn't conflict with IO::Path? Isn't that two separate namespaces? 21:19
lizmat .slurp-rest doesn't close the handle, .slurp does
21:20 virtualsue__ is now known as virtualsue
japhb To possibly short circuit things: qqx(<< foo bar $baz "qu ux" >>) ought to do the right thing, IMHO, and that does not involve the shell. 21:20
21:20 dylanwh joined
lizmat should or should not .slurp close the handle when called on an opened handle ? 21:20
masak qqx is not a function, it's a quoting construct.
lizmat masak:: underneath it is, but yeah 21:21
masak m: say qq(foo bar)
camelia rakudo-moar 81d173: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EXRZqyanx2␤Undeclared routines:␤ bar used at line 1. Did you mean 'bag'?␤ foo used at line 1␤ qq used at line 1␤␤»
japhb masak: Not if it's got 'qqx(...)'. Function interpretation should win.
masak oh, apparently not.
japhb: yes, just realized.
21:21 virtualsue_ left
lucasb lizmat: I guess this has already been discussed. I was not here, but my opinion is that .slurp on a handle should not close, after all the handle was alread open 21:22
AlexDaniel well, the problem is that qqx invokes the shell but it should not. There is no way to fix this other than just stop using the shell, that's what geekosaur pointed out in the previous discussion
japhb AlexDaniel: qqx// or qx// invokes the shell, because it doesn't have a choice. But qx() need not. 21:23
One is a quoting construct, the other is just a function call.
lizmat lucasb: but .slurp on an IO::Path should, right ?
lucasb lizmat: I would say yes :)
japhb Or are you arguing that a quoting construct ought to try to do some magic parsing?
lizmat lucasb: and on $something.slurp ? should it close $something or not ? 21:24
AlexDaniel you can split the thing into parameters correctly, but that's not enough. You can quote the parameters, but it's not that easy because how would you know the rules of the underlying shell?
japhb AlexDaniel: Are you talking about my qqx(<< foo bar $baz "qu ux" >>) example? 21:25
AlexDaniel japhb: I don't really understand why qx and qqx should do things differently
lucasb Is $something an IO::Path or an IO::Handle? that distinction says what to do
japhb You don't care about the quoting rules of the underlying shell ... << ... >> has (very smart) quoting rules already.
AlexDaniel japhb: any example involving 'x'
japhb: how << >> quote $( ) ? 21:26
japhb AlexDaniel: it's not qqx v. qx. It's q// v. q().
AlexDaniel oh
japhb AlexDaniel: However Perl 6 would interpret it. << ... >> is a quoting slang.
That is very smart about quoting and interpolation.
lizmat lucasb: so that's interface consistency: when you call .slurp on something, you don't know whether that will close something or not 21:27
japhb Lemme see if I can find the spec reference
masak m: my $s = '$(rm -rf)'; say <<echo $s>>.perl
camelia rakudo-moar 81d173: OUTPUT«("echo", ("\$(rm", "-rf)"))␤»
lizmat rather than adding a :close parameter to .slurp, it felt better to add a .slurp-rest
AlexDaniel my $s = '`rm -rf`'; say <<echo $s>>.perl
m: my $s = '`rm -rf`'; say <<echo $s>>.perl 21:28
camelia rakudo-moar 81d173: OUTPUT«("echo", ("`rm", "-rf`"))␤»
lizmat but, as many things with things backported from the newio branch, it can still change
if consensus wants slurp-rest dead, and a :close parameter added to .slurp, I can also live with that
AlexDaniel m: my $s = '`shutdown`'; say <<echo $s>>.perl
camelia rakudo-moar 81d173: OUTPUT«("echo", "`shutdown`")␤»
lucasb lizmat: to me that's polymorphism; different classes do different things with the messages they receive. :)
AlexDaniel so it does not work, right? 21:29
japhb AlexDaniel: S02:3591
dalek Heuristic branch merge: pushed 66 commits to rakudo/newio by lizmat 21:30
japhb AlexDaniel: I don't understand what you mean by "does not work" here. What are you pointing out? 21:31
AlexDaniel: I'm guess you're pointing out that the '`rm -rf`' is getting split one extra time ... in which case that's just a bug, not a spec failure. 21:32
AlexDaniel japhb: Shell injection. If you can manipulate $s then run any command. In this example I ran "shutdown": my $s = '`shutdown`'; say <<echo $s>>.perl
japhb: please correct me if I'm wrong
japhb AlexDaniel: OK, you're wrong. :-0
AlexDaniel japhb: could be, why? 21:33
japhb AlexDaniel: executing qx(<<echo `shutdown`>>) would be the same as qx(['echo', '`shutdown`']<>), and if qx() does not involve the shell, then no problem. 21:34
AlexDaniel yea, right 21:35
japhb I wonder if there's namespace confusion here ... quoting constructs and callables are in separate namespaces. No need for the quoting construct and the function to *both* be shellish.
masak as long as there's a consistent rule in there somewhere. 21:36
japhb Would it help if I called qx() something like my-qx-func() instead? :-)
AlexDaniel so qx() would be a shortcut for run(..., :out).out.slurp-rest ?
21:37 caymanboy joined
caymanboy Caymanboy in da house 21:37
japhb masak: My thinking is that a quoting construct flattens to a single string (or the moral equivalent, like a Cat), and thus *must* use the shell if there is a space in the string. Whereas the function form should always *NOT* use the shell.
AlexDaniel: Yes! :-)
masak caymanboy: mi casa es su da house 21:38
caymanboy Had a perl8 burger at www.xqs.ky, it was awesome. Just had to wait a while
<cough>
err 6
AlexDaniel japhb: then what about giving it a distinguishable name? Like, um, "echo" ?
ugexe QX is shell, not a process 21:39
21:39 Hor|zon joined
caymanboy nothing worse that fing up a funny 21:39
masak caymanboy: "awesome, just had to wait a while" is our inofficial slogan. :) 21:40
japhb ugexe: I know, I had been talking about multi behavior ... but let's leave QX out of it for now. AlexDaniel and I are having enough trouble without that confusion (which yes, I brought on myself).
caymanboy new mascot, the hour glass
AlexDaniel ugexe: well, I guess that you have to scroll up a bit :)
japhb caymanboy: "OMG, what will you call it?" ... "The Aristocats!" ... DAMMIT! 21:41
caymanboy I will be coding p6 in pergatory
japhb ... and you will feel like you made it to heaven. 21:42
masak .oO( more like "15 year-glass" , ammarite? ) :P
caymanboy fyi: I sent slickedit.com whether they will be supporting p6 in their new releaase. they said if its just syntax , we will includes it in the bext release.... 21:43
21:43 Hor|zon left
caymanboy i jupmed the gun a bit 21:43
note to self. dont irc on chardonnay 21:44
AlexDaniel japhb: last time I jokingly suggested backticks for that irclog.perlgeek.de/perl6/2015-06-27#i_10814033 21:45
masak was wondering what exactly it was on
AlexDaniel japhb: as stupid as it sounds, but it is shorter that qqx// or any other variant
japhb: and kinda familiar
than*
masak AlexDaniel: backticks are "reserved" as custom circumfix operators for module space. 21:46
japhb AlexDaniel: Sure. I think `...` is currently reserved in Perl 6 for module-space use (or in general, non-core uses).
caymanboy listen, you guys need to get cracking, I told all my cayman friends Perl6 was the python killer
masak caymanboy: we don't kill snakes, we convert them. 21:47
caymanboy I prefer consuming
masak caymanboy: Python is just a really odd way to write Perl 6.
nys "perl 6 burger"
the perl 6 burger subsumes all other burgers
caymanboy I joined up a company that is making me code in python. this is why I'm here 21:48
do something
masak caymanboy: :)
japhb caymanboy: It happens to the best of us. Well, OK, it happens to many of us. ;-)
masak caymanboy: I teach Python. more market demand than Perl right now. but my heart is with Perl 6.
caymanboy perl6 is glorious. I love whats hapening w 21:49
masak Python is an OK language. I love how far they get on basically being sane and conservative. but I also see that that only gets you so far. 21:50
21:50 caymanboy left
AlexDaniel I can't really see any solution though. qqx// is so short, it is really hard to beat it. Especially considering that you will probably have to use << >> which is 4 or 2 characters longer... 21:50
21:50 zakharyas joined
ab5tract_ likes qq:x{...} 21:51
21:52 amurf joined
AlexDaniel is :x a shortened form? Is there any longer variant? 21:53
ab5tract_ it feels nice and explicit, but I recognize that other people prefer to keep these sorts of things as absolutely short, character-wise, as possible
AlexDaniel ab5tract_: qq:run_in_shell_nonsecure{} is a bit more informative though 21:54
21:54 caymanboy joined
caymanboy I apologize for that rude interruption 21:54
ab5tract_ s/_/-/
:)
caymanboy cayman inet isn't exactly fios
anyways 21:55
I need a date
masak caymanboy: oh, so you're actually from the Cayman islands?
ab5tract_ AlexDaniel: it seems to me that most people would expect such a feature to "shell out"
caymanboy how long will YOU make me suffer coding python 21:56
masak: yes
masak caymanboy: I've been using Perl 6 in production since 2010.
21:56 amurf left
caymanboy hmmm rakudo? 21:56
ab5tract_ and most people know that shelling out is as insecure as the shell and the commands passed to it
masak caymanboy: it's mostly a question of your pain threshold and idealism.
caymanboy: yes, Rakudo. first on Parrot, nowadays on Moar. 21:57
caymanboy yes, very confusing
AlexDaniel ab5tract_: hah, I like that
caymanboy I thought parrot what the ultimate vm
masak caymanboy: confusing, but ultimately good for the users.
japhb AlexDaniel: I still think the non-Texas version of qx(<< ... >>) is pretty reasonable. # Sorry, Unicode is a *pain* to enter into this terminal emulator.
masak caymanboy: it's good that Perl 6 *can* run on many VMs. 21:58
AlexDaniel japhb: it is still longer than qqx//, isn't it?
caymanboy thats awesome. it does'nt help the fact that they are making me code python
you have a marketing problem 21:59
masak caymanboy: no argument there.
caymanboy guess what, that's what I'm good at
masak caymanboy: another inofficial slogan is "we suck at marketing". it's actually from the Perl 5 community, but it still applies.
caymanboy no shit
p6 in my limited view blows away python 2 and 3 22:00
masak yeah; it's nice
caymanboy but i have to code in python because.... NOT that it does anything more or better 22:01
because it "easier" and more "popular"
masak caymanboy: don't know if it helps you, but... I find there's a lot of small, non-user-facing problems I can still solve in p6, even when I'm coding in something else 22:02
AlexDaniel masak: yes
ab5tract_ caymanboy: well, it's also well ahead of p6 in terms of tooling and ecosystem 22:03
and programmers :)
AlexDaniel ab5tract_: and maturity, in some sense.
masak we're trying to learn from the failings and setbacks of py3k as much as we can here. 22:04
AlexDaniel because the chance of some bug jumping right into your face is pretty high at the moment :)
caymanboy intermission my rude cayman friends are interrupting me
apologies
masak the "funny" thing is that py3k was pretty determined to learn from the failings and setbacks of p6... 22:05
guess everyone has to invent and make their own mistakes.
caymanboy www.xws.ky loves perl6 22:06
www.xqs.ky 22:07
im a really bad tuper
AlexDaniel masak: I'm not sure if they were trying to learn anything, actually. www.artima.com/weblogs/viewpost.jsp?thread=98196 22:08
masak AlexDaniel: I've seen that one, yes. 22:10
22:11 zakharyas left
ab5tract_ masmas 22:11
22:11 ohb left
caymanboy ok perl people, I would love to make a great intellectual contribution, however i'm one chardonnay above that sitiation. Perl6 for life baby. you have support in Cayman baby! 22:11
22:11 ohb joined
caymanboy word 22:11
22:11 caymanboy left
masak feels comforted to have support in Cayman 22:12
nys cayman's always the swing vote 22:13
masak oh, south of Cuba. I see. 22:19
RabidGravy you'll be glad of the connection when you want to save some tax on your millions 22:21
itz__ donote with some of those offshore tax avoidance $$$
japhb valiantly fights the urge to defenestrate his computer 22:22
RabidGravy do it! do it!
japhb RabidGravy: I think I'm going to go get some pizza instead. Pizza makes everything better. 22:23
RabidGravy beer, beer makes everything better. Pizza just helps ;-) 22:24
I haven't had pizza in more than a year mind
22:26 lucasb left 22:27 spider-mario left
lizmat preparing and commute to PDX& 22:27
22:27 lizmat left 22:28 espadrine_ left, TEttinger joined 22:35 atroxaper joined 22:39 atroxaper left
masak 'night, #perl6 22:40
virtualsue pizza++ 22:43
22:47 mudguts joined 22:51 mudguts left 22:53 raiph joined 23:11 leont left 23:14 RabidGravy left, dj_goku left 23:15 dj_goku joined, raiph left 23:27 ][Sno][ left 23:28 [Sno] joined, Hor|zon joined 23:32 Hor|zon left
ab5tract_ finally cracked the overlaps-with logic :D 23:40
AlexDaniel is there any way to precompile a file so that it executes faster?
23:42 amurf joined
ab5tract_ AlexDaniel: yup. there are have been issues with pre-comp though. the order of pre-compilation matters (or has mattered) 23:44
AlexDaniel ab5tract_: ok, how?
ab5tract_ right, I haven't bothered much because of the issues
23:46 BenGoldberg joined
ab5tract_ so I can't tell you off-hand 23:46
japhb AlexDaniel: The easiest way is to install it with panda.
23:46 amurf left
AlexDaniel japhb: it – what? My code? 23:47
japhb Funnily enough, I just managed to improve run time in my current project that it is now dominated by module loading. methinks I will need to take my own advice soon. 23:48
AlexDaniel: Yes. You can say 'panda install .' (assuming you have the metadata file, META.json IIRC), and it will compile all the modules and put them into your CURLI, so they load *much* faster. 23:49
Of course, that then needs to be part of your development iteration ...
ISTR ufo can do this as well, with slightly different workflow. 23:50
ab5tract_ AlexDaniel: you got me curious, so I started chasing 23:52
the gory bits, including how to get proper compilation order, are in Panda::Builder 23:53
you can quickly get at the source code by invoking: panda look panda
the vim lib/Panda/Builder.pm, once you are in the chroot
actually, I'm not sure whether it is a chroot or just a new shell, but anyway... 23:55
AlexDaniel uhh! 23:57