»ö« 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.
Xliff Is self defined by the time method new() is executed? 00:02
Durrr... prolly not. 00:04
timotimo nope, only if you call .new on an instance 00:08
like "Foobar".new
then self will obviously be "Foobar" 00:09
timotimo oh no, what's happening to hack now 00:31
timotimo oh, it collected itself again 00:32
Herby_ Evening, everyone! 02:12
o/
sortiz \o Herby_
dalek osystem: 22d5ba4 | (Zoffix Znet)++ | META.list:
Add ווו to the ecosystem

666th module in the Perl 6 Ecosystem is properly Evil!
  github.com/zoffixznet/perl6-666
02:34
Zoffix chortles 02:35
Zoffix I also may have found issues with having unicode in module names. It was giving me "use of unitialized value" or something when I had `unit module ווו;` though I'm unsure if that was just clashing with the sub named ווו ¯\_(ツ)_/¯ 02:38
raydiak .u ו 02:40
yoleaux U+05D5 HEBREW LETTER VAV [Lo] (ו)
raydiak clever :) 02:40
Zoffix :( "Cannot access '$_' through CALLER, because it is not declared as dynamic" 03:08
Is this feature new? This is on 2016.04 and I'm sure my Pretty::Topic worked before :/ 03:09
Zoffix m: package Foo { class Bar {} }; import Foo; Bar.new 03:14
camelia rakudo-moar 9b579d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤ Bar used at line 1. Did you mean 'Bag'?␤␤»
Zoffix m: module Foo { class Bar {} }; import Foo; Bar.new
camelia rakudo-moar 9b579d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤ Bar used at line 1. Did you mean 'Bag'?␤␤»
Zoffix *sigh*
Zoffix m: module Foo { sub term:<♥> { $CALLER::_ }; say ♥ for ^4; class Bar { method update { say ♥ for ^4}} }; import Foo; Foo::Bar.new.update 03:16
camelia rakudo-moar 9b579d: OUTPUT«0␤1␤2␤3␤0␤1␤2␤3␤»
Zoffix Oh gee... another precompilation bug. 03:16
(╯°□°)╯︵ ┻━┻
Zoffix And this is after downgrading to 2016.04 to avoid a different precomp bug ~_~ 03:17
Production ready my ass 03:19
Util Memory fails me... Do we have an `if defined` control structure? 04:23
I want to collapse this nested block:
given $foo<bar><baz> -> $quux { if $quux.defined { ... } }
into this single block:
ifdefined $foo<bar><baz> -> $quux { ... }
with some control statement or keyword meaning "ifdefined".
konobi Util: damian's talk had an example 04:24
done as an infix operator
Util konobi: Thanks, but could you be more specific? Damian gave 6 talks. 04:25
( 3 paid classes , a keynote, and 2 secret talks where someone else gave the first half, I thing)
s/thing/think/
konobi on the backs of giants
Util Ah, the keynote! I was there, but distracted. I will review it in the morning. Thanks! 04:26
TimToady Util: that's with/orwith/else 04:27
tests for defined and also topicalizes 04:28
TimToady goes to be himownself...
Util TimToady: I see it now in [S04] `=head2 The C<with> and C<without> statements` and Roast/S04-statements/with.t . 04:29
So much to keep up with :) Thanks!
cognominal m: my $a = 1; say $a.^roles 04:57
camelia rakudo-moar 9b579d: OUTPUT«((Real) (Numeric))␤»
cognominal m: my $a = 1 but False; say $a.^roles
camelia rakudo-moar 9b579d: OUTPUT«((<anon|74632384>) (Real) (Numeric))␤»
cognominal m: my $a = 1.1; say $a.^roles 04:58
camelia rakudo-moar 9b579d: OUTPUT«Cannot unbox a type object␤ in block <unit> at <tmp> line 1␤␤»
cognominal m: my Int $a = 1 but False; say $a.^roles 04:59
camelia rakudo-moar 9b579d: OUTPUT«((<anon|78530416>) (Real) (Numeric))␤»
cognominal m: my int $i = 1 but False; say ?$i 05:02
camelia rakudo-moar 9b579d: OUTPUT«True␤»
cognominal should not be a warning that assigning to a native gives a value stripped from any rule ? 05:04
m: 1.1.^roles 05:07
camelia ( no output )
cognominal m: say 1.1.^roles
camelia rakudo-moar 9b579d: OUTPUT«Cannot unbox a type object␤ in block <unit> at <tmp> line 1␤␤»
geekosaur m: say Num.^roles 05:09
camelia rakudo-moar 9b579d: OUTPUT«((Real) (Numeric))␤»
geekosaur m: say 1.1.WHAT
camelia rakudo-moar 9b579d: OUTPUT«(Rat)␤»
geekosaur m: say Rat.^roles
camelia rakudo-moar 9b579d: OUTPUT«Cannot unbox a type object␤ in block <unit> at <tmp> line 1␤␤»
sortiz m: say $_.perl for 1.1.^roles; # Rational[Int,Int] fails .gist;
camelia rakudo-moar 9b579d: OUTPUT«Rational[Int,Int]␤Real␤Numeric␤»
geekosaur Rat has a rat in its roles...
sortiz geekosaur, nop, the problem is 'Rational[Int,Int].gist', see: 05:12
m: say Rational[Int,Int];
camelia rakudo-moar 9b579d: OUTPUT«Cannot unbox a type object␤ in block <unit> at <tmp> line 1␤␤»
sortiz
.oO( Oh, a rat, ya. :-) )
05:15
Woodi m: my @w = <a b c>; print "{@w.pick}\n" xx 3; 05:26
camelia rakudo-moar 9b579d: OUTPUT«c␤ a␤ c␤»
Woodi how to get rid of spaces there ?
sortiz m: my @w = <a b c>; print join '', "{@w.pick}\n" xx 3; # xx produces a List. 05:32
camelia rakudo-moar 9b579d: OUTPUT«a␤a␤b␤»
dupek I would better learn Perl :D 05:43
than Perl6
Woodi dupek: it's XXI century, learn many languages :) 05:47
sortiz learn Perl is always a good idea. 05:48
dupek yeah, but writing my own framework in Perl6 is going so slow since I think I would change my job soon 05:48
brutal life :( 05:49
cognominal m: (1|2).WHAT 05:50
camelia ( no output )
cognominal m: say (1|2).WHAT
camelia rakudo-moar 9b579d: OUTPUT«(Junction)␤»
Woodi dupek: generally Perl6 isn't yet ready for "commercial" project... but for making a sketch of functionalities/design discovery it's very nice 05:51
dupek Woodi, that's true
Woodi sortiz: thanx
cognominal in the REPL (1|2).WHAT crashes it 05:52
dupek Woodi, I think people should focus on to create something similar to perl6 maven tutorial
but it is okay 05:53
=)
Woodi cognominal: cognominal don't crashes for me, 2016.05 05:56
er, I mean *example* don't crash... :)
Zoffix: so, basically, you hacked say twice ? :) so same story for: npm, Docker, buildroot, Vagrant, ... ;) 06:01
sortiz cognominal, seems new REPL needs a few explicit Mu in some signatures. 06:06
In particular input-incomplete and repl-print methods. 06:07
cognominal I guess I fit the TimToady's characterization of testers as nasty people. :( but he used some euphemism instead
Woodi, I use the most recent git version. 06:08
I think I am more like people who disassemble clocks with no clue how to put it them back together. 06:09
But this gives some appreciation for the work of people who designed the clock in the firt place. 06:10
Woodi cognominal: I imagine testers just operate on hacking instinct drug :) just like eg. jurnalists 06:11
cognominal > (1|2).WHAT
===SORRY!===
Type check failed in binding $value; expected Any but got Junction (Junction)
sortiz cognominal, I just made a PR: github.com/rakudo/rakudo/pull/802 06:21
cognominal sorry, I am too busy finishing slides 06:25
cognominal class A { has $.a }; A.^attributes 07:26
m: class A { has $.a }; A.^attributes 07:27
camelia ( no output )
cognominal m: class A { has $.a }; say A.^attributes
camelia rakudo-moar a8aa18: OUTPUT«(Mu $!a)␤»
cognominal m: my $a; say $a.WHAT
camelia rakudo-moar a8aa18: OUTPUT«(Any)␤»
cognominal m: class A { has $.a }; say A.new.WHAT 07:28
camelia rakudo-moar a8aa18: OUTPUT«(A)␤»
psch m: class A { has $.a }; my $a = A.new(a => 1&2); say $a.perl
camelia rakudo-moar a8aa18: OUTPUT«A.new(a => all(1, 2))␤»
cognominal m: class A { has $.a }; say A.new.a.WHAT
camelia rakudo-moar a8aa18: OUTPUT«(Any)␤»
cognominal Mu because it can contain Junction 07:29
psch right. i don't think having my example generate a superposition of two As, one with :1a, one with :2a, would what most people expect 07:30
+be
dalek line-Perl5: 313aa77 | wamba++ | lib/Inline/Perl5.pm6:
Bug #65 solution

I think, the change solve bug #65. Test argv.t is success. Switches for Perl 5 one-liner must be written behind '--'.
07:31
line-Perl5: 9499d69 | niner++ | lib/Inline/Perl5.pm6:
Merge pull request #66 from wambash/patch-1

Bug #65 solution
Many thanks to wambash++! This would have been so hard to fix when you don't know that there is in fact an easy fix.
hankache hola #perl6 07:54
sortiz hola hankache 08:09
hankache hi sortiz 08:10
cognominal salut hankache 08:13
hankache bonjour cognominal
timotimo hack.p6c.org/~timo/ - i meant to stop fuzzing when the light gray shaded area hits the dark gray shaded area's upper bound ... and then it goes and does *that* 08:34
psch heh 08:35
dalek Iish: 275f496 | (Salvador Ortiz)++ | / (2 files):
Oracle: connect now accepts named argument 'user'

To be consistent with other drivers and documentation.
08:36
Iish: 945f572 | (Salvador Ortiz)++ | / (2 files):
For panda's/zef's users, now v0.5.9
hankache m: sub squared3 ($num) returns Int { return (say 'blablabla').WHAT.say; }; say "7 to squared is equal to " ~ squared3(7); 08:45
camelia rakudo-moar 6afd0b: OUTPUT«blablabla␤(Bool)␤7 to squared is equal to True␤»
hankache hmmmm. Shouldn't this fail ^^ 08:45
sortiz m: say so Bool ~~ Int; 08:46
camelia rakudo-moar 6afd0b: OUTPUT«True␤»
timotimo yeah, say returns True 08:47
psch m: my Int $x = True 08:48
camelia ( no output )
brrt do we still have LoL in perl6
and the Cat type
hankache say returns true but i expected the return trait to complain about bool
psch brrt: Cat never was implemented, but LoL is just gone i think
hankache: but Bool isa Int
brrt that is too bad 08:49
sortiz And in general any simple enum isa Int
hankache ok
brrt no role LolCat for me
hankache m: sub squared ($num) returns Int:D { }; say squared(2); 08:50
camelia rakudo-moar 6afd0b: OUTPUT«Nil␤»
hankache shouldn't the :D complain in this case ^^ ? 08:51
psch m: my Int:D $x = Nil
camelia ( no output )
psch m: my Int:D $x = Nil; say $x.WHAT
camelia rakudo-moar 6afd0b: OUTPUT«(Int:D)␤»
psch ...that's kind of amazing 08:52
sortiz hankache, Nil and Failure are exempt for returns constraints.
psch m: my Int:D $x = Nil; say $x.defined
camelia rakudo-moar 6afd0b: OUTPUT«False␤»
hankache sortiz but then what's the purpose of :D? 08:53
psch m: sub squared ($num) returns Int:D { Int }; say squared(2);
camelia rakudo-moar 6afd0b: OUTPUT«Type check failed for return value; expected Int but got Int␤ in block <unit> at <tmp> line 1␤␤»
sortiz m: sub squared ($num) returns Int:D { Int }; say squared(2); 08:54
camelia rakudo-moar 6afd0b: OUTPUT«Type check failed for return value; expected Int but got Int␤ in block <unit> at <tmp> line 1␤␤»
timotimo i think our variables with :D just straight up don't work properly with regards to default values
as in, no default value specified
hankache and this is a LTA: "expected Int but got Int"
sortiz Yep, indeed LTA, but Nil and Failure are special cased. 08:55
hankache Well i was trying to see how to prevent a sub from returning nothing 08:57
:D doesn't help since it doesn't catch Nil
any alternatives?
timotimo you don't "catch" nil when assigning to variables 09:07
assigning Nil will reset the default value
if you don't have a sensible default value, you'll be in trouble
psch fwiw, with implicit return i find you have to actually go out of your way to accidentally return Nil 09:09
timotimo yeah
you need to find something that returns Nil for you
or --> Nil :)
psch right, but the latter is pretty explicit :) 09:10
timotimo it's still "return at the end of the last block", though :)
hankache thanks 09:11
hankache m: sub squared ($num) returns Int:D { my Int $x = $num; $x = Nil; return $x}; say squared(2); 09:15
camelia rakudo-moar 6afd0b: OUTPUT«Type check failed for return value; expected Int but got Int␤ in sub squared at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
hankache so this is an example
psch yeah, you're purposefully reseting $x to Int 09:16
hankache yes 09:17
psch m: sub squared ($num) returns Int:D { my Int $x is default(-1) = $num; $x = Nil; return $x}; say squared(2);
camelia rakudo-moar 6afd0b: OUTPUT«-1␤»
psch is one solution
i suppose
timotimo and the output doesn't mention it expected Int:D
sortiz m: sub squared ($num) { POST { die unless .DEFINITE; True }; 4 }; say squared(2); # Check for :D
camelia rakudo-moar 6afd0b: OUTPUT«4␤»
sortiz m: sub squared ($num) { POST { die unless .DEFINITE; True }; Int }; say squared(2); # Check for :D
camelia rakudo-moar 6afd0b: OUTPUT«Died␤ in sub squared at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch .oO( CORE::.keys.grep(/^'&'/)>>.candidates>>.^add_phaser('POST', { die unless .DEFINITE; True }) ) 09:19
psch i mean, i don't know that dealing with the absence of a value should always be completely automatic 09:21
hankache thanks
sortiz yw 09:22
psch so, assuming the "= Nil" is a placeholder for a routine that could return Nil, i'd probably do "//= that-sub()" vOv
instead of phasers or defaults
ah, no, that's wronng
"= that-sub // $fallback" 09:23
psch m: my $x = "foo"; $x //[R=] Nil; say $x # heh 09:28
camelia rakudo-moar 6afd0b: OUTPUT«foo␤»
psch m: my $x = "foo"; $x //[R=] 5; say $x
camelia rakudo-moar 6afd0b: OUTPUT«foo␤»
psch aww 09:29
oh, bad bracket b^Hplacement
m: my $x = "foo"; $x [//R]= 5; say $x
camelia rakudo-moar 6afd0b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in bracketed infix; couldn't find final ']' ␤at <tmp>:1␤------> 3my $x = "foo"; $x [//7⏏5R]= 5; say $x␤»
psch m: my $x = "foo"; $x [R//]= 5; say $x
camelia rakudo-moar 6afd0b: OUTPUT«5␤»
psch that i like
m: my $x = "foo"; $x [R//]= Nil; say $x
camelia rakudo-moar 6afd0b: OUTPUT«foo␤» 09:30
hankache so :D and :I are called smilies, but do they have a formal name? 09:31
psch i think 'type smilies' is the formal name 09:32
hankache lol ok
psch although could be made for 'definedness constraint colonpair' or so as more formal
+a case
hankache type constraint 09:33
dalek Iish: 3195890 | (Salvador Ortiz)++ | README.pod:
Add Oracle to README.pod
psch right, yeah, they're a constraint on the type so that's probably it 09:34
sortiz rest time, #perl6 o/
hankache ciao sortiz 09:35
dalek c: f3d933e | (Jan-Olof Hendig)++ | doc/Type/Map.pod:
Added docs for Map.Bool
DrForr_ Everybody made it back okay? 09:47
timotimo en.wikipedia.org/wiki/Fortune%27s_algorithm - someone want to implement this in p6? :3 10:11
timotimo is reading through www-cs-students.stanford.edu/~amitp...eneration/ 10:12
TimToady sitting at gate at MCO 10:16
llfourn m: my &code = *.split("\n"); code("foo\nbar").^name.say # :/ 10:26
camelia rakudo-moar 6afd0b: OUTPUT«BOOTArray␤»
timotimo m: (*.split("\n"))("foo\nbar").WHAT.say 10:33
camelia rakudo-moar 6afd0b: OUTPUT«Cannot find method 'say': no method cache and no .^find_method␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: (*.split("\n"))("foo\nbar").WHAT.^name.say
camelia rakudo-moar 6afd0b: OUTPUT«BOOTArray␤»
timotimo that's strange, yeah
psch # since most of data structures are built already, there is little
# point in making this a lazy iterator here
src/core/Str.pm:2194 10:34
and $matches is the result of nqp::split
psch curious that the whatever curry brings that out though 10:34
soo maybe it's not exactly the right spot to look :| 10:35
timotimo oh, it might be skipping a hllize 10:36
psch yeah, but why would that only happen if it's bound to a whatever? 10:37
llfourn m: { .split("\n") }.("a\nb").^name.say
camelia rakudo-moar 6afd0b: OUTPUT«List␤»
llfourn m: (*.split("\n") ).("a\nb").^name.say
camelia rakudo-moar 6afd0b: OUTPUT«BOOTArray␤»
timotimo well, generating whatevercode code is different from building just any regular old block 10:38
kalkin- Hmm $=data<Foo> is not implemented, any work around for that? 10:39
besides just iteration through $=pod and picking the things one need 10:40
Or can i declare somehow my own pod variables? For example $=foo? 10:42
timotimo it you don't declare them, they just pick up whatever =foo you have in your pod
at least i think so
kalkin- If I use anthing besides $=pod after the $= sigil i get Pod variable $=foo not yet implemented. Sorry 10:44
llfourn I think there is $=finish or something as well? 10:45
timotimo oh
kalkin- i.c 10:48
But i can't declare arbitrary data in POD, and later access that in code? (Besides iterating through =pod and picking the things I need) 10:49
llfourn I'm not 100% but I think that's what ppl use $=finish for 10:50
there maybe a better NYI way
timotimo yeah, NYI is the problem here
lots of things are speculated in the speculations
kalkin- Hmm say $=finish just returns (Mu) for me 10:51
how can i use it?
timotimo i.imgur.com/flkNNWv.png 10:52
psch m: $=finish.perl.say ␤=finish␤bar baz␤=end finish␤
camelia rakudo-moar 6afd0b: OUTPUT«"bar baz\n=end finish\n"␤»
timotimo there is no =end finish
llfourn timotimo++ # image examples
psch yeah, i see that now :S
timotimo :D
finish is already the end of everything!
psch it's the end of ambient blocks at least :P
(that's an almost-quote, too) 10:53
psch C<=finish> No ambient blocks after this point 10:53
kalkin- I see. Thank you. 10:54
I will experiment if I can reuse it 10:55
timotimo for better re-use i should have put more interesting data in than "what even is this\n" 10:58
hahainternet timotimo: your font is weird :) 10:59
kalkin- it's to tiny :)
timotimo monaco regular 10
hahainternet the kerning is so tight, and there's no antialiasing :o
timotimo it's big to me
kalkin- no tiny is wrong word, it's narrow :)
hahainternet it looks ok in the non bold, although the bar of the t is way low 11:00
kalkin- ic
hahainternet and it looks slightly disjointed to me
timotimo *shrug*
hahainternet i.imgur.com/oxiTDm6.png 11:01
dejavu sans mono for me i think, in 8 or 9
timotimo that's uncomfortable to look at on my monitor
hahainternet interesting 11:02
i find it quite nice
timotimo maybe it's the wrong subpixel alignment
hahainternet i think it might be hinted, and it'll be RGBA
RGB*
kalkin- recommends Fira Mono
hahainternet but maybe you use a pentile monitor or similar
i'm on an IPS with standard order
timotimo i have an IPS in front of me, too 11:04
hahainternet odd :o 11:05
the thing that matters to me most is the clear distinction between characters and the consistent letter height
kalkin- So i ended up just doing for $=pod -> $f { filter things i need }. This is fine with me. I just want p6pod doesn't show the word data from =begin data 11:10
I want to assign it an alternative title, is it possible?
searching through S26 doesn't yield anything intersting
dalek c: 50b13a5 | (Jan-Olof Hendig)++ | doc/Type/Map.pod:
Added doc for methods Int and Numeric in Map
11:58
kalkin- I can't markup in POD that something needs to be centered? 12:02
tbrowder docs: please consider PR: github.com/perl6/doc/pull/635 12:08
moritz kalkin-: POD is semantic markup, not styling markup 12:09
moritz tbrowder: I've added two comments on the pull request 12:19
tbrowder moritz: I've replied... 12:33
grondilu m: my @a = [1, 2]; my @b = 1, 2; dd @a; dd @b; 12:35
camelia rakudo-moar 6afd0b: OUTPUT«Array @a = [1, 2]␤Array @b = [1, 2]␤»
grondilu ^there's no difference at all, is there?
jnthn grondilu: Nope, thsoe two are the same (due to the single argument rule) 12:37
moritz tbrowder: I think the docs should say thing about whitespace not allowed before the parens 12:42
tbrowder: though not the way you approached it 12:43
tbrowder okay. I'll work on another version--thanks!
moritz and I feel really uncomfortable rejecting the first version 12:44
Tushar Hello, how can I specify type of array which has been passed to sub as argument? I tried sub testFunc (Int @a) { ... }, but I am getting error while running the code. 12:46
The error I am getting is: Type check failed in binding @a1; expected Positional[Int] but got Array ($[1, 2, 3, 4, 5]) in sub multiply at arrayMultiplication.p6 line 7 in block <unit> at arrayMultiplication.p6 line 11 12:47
CIAvash m: sub f (Int @a) { say @a }; f(Array[Int].new: 1,2,3) 12:50
camelia rakudo-moar 6afd0b: OUTPUT«[1 2 3]␤»
tbrowder moritz: please don't be uncomfortable! I appreciate the critique. 12:53
moritz Tushar: if you say (Int @a), it restricts to an Array[Int], which means you also have to pass in an Array[Int], not just an array that happens to contain integers 12:59
Tushar: there is no declarative sytanx for "array that happens to contain only integers"
Tushar mortiz: that make sense. Do I have to check each element of array separately in order to check whether all of them are integer or not? 13:04
moritz m: sub f(@x where { all(@x) ~~ Int }) { say @x.perl }; my @a = 1..3; my @b = 'foo'; f @a; f @b; # for Tushar 13:08
camelia rakudo-moar 6afd0b: OUTPUT«[1, 2, 3]␤Constraint type check failed for parameter '@x'␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
moritz m: sub f(@x where { all(@x) ~~ Int or fail "Not all elements are integers." }) { say @x.perl }; my @a = 1..3; my @b = 'foo'; f @a; f @b; # for Tushar 13:09
camelia rakudo-moar 6afd0b: OUTPUT«[1, 2, 3]␤Not all elements are integers.␤ in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
CIAvash m: sub f (@a where { .all ~~ Int }) { say @a }; f [1,2,3] 13:10
camelia rakudo-moar 6afd0b: OUTPUT«[1 2 3]␤»
Tushar mortiz: thanks for your help. What if two arrays or multiple arrays are passed? 13:11
moritz Tushar: what about it? 13:13
gfldex m: subset ArrayContainingInts of List where { .all ~~ Int }; sub f(ArrayContainingInts $a, ArrayContainingInts $b) { say 'fein' }; f([1,2,3],[4,5,6]); 13:14
camelia rakudo-moar 6afd0b: OUTPUT«fein␤»
Tushar mortiz: if we pass two arrays or multiple arrays as arguments can we check the type check in once or do we have to check all them separately? 13:15
psch m: sub f(@ [@a where { .all ~~ Int }, @b where { .all ~~ Int }]) { }; f [[1,2,3],[4,5,6]] 13:16
camelia ( no output )
gfldex m: sub f(*@all [ @a, @b]) { say 'fein' }; f((1,2,3),(4,5,6)); 13:17
camelia rakudo-moar 6afd0b: OUTPUT«cannot stringify this␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch m: sub f(+@all [ @a, @b]) { say 'fein' }; f((1,2,3),(4,5,6)); 13:18
camelia rakudo-moar 6afd0b: OUTPUT«fein␤»
psch m: sub f(**@all [ @a, @b]) { say 'fein' }; f((1,2,3),(4,5,6));
camelia rakudo-moar 6afd0b: OUTPUT«fein␤»
gfldex m: sub f(+@all [ @a, @b] where { .all.all ~~ Int }) { say 'fein' }; f((1,2,3),(4,5,6));
camelia rakudo-moar 6afd0b: OUTPUT«fein␤»
gfldex m: sub f(+@all [ @a, @b] where { .all.all ~~ Int }) { say 'fein' }; f((1,2,'drei'),(4,5,6)); 13:18
camelia rakudo-moar 6afd0b: OUTPUT«Constraint type check failed for parameter '@all'␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
DrForr_ Hrm. todo() seems to be partially implemented - It prints the 'TODO $message' but doesn't skip the next test as advertised. 13:19
moritz Tushar: if you want the result to be a single array, you can declare it to be slurpy, and do just one check
DrForr_ (sorry, Test::todo() - A bit ambiguous there.)
psch DrForr_: todo doesn't skip, skip skips 13:20
DrForr_: todo is really just for TAP parsers as i understand it
moritz m: sub f(*@x where { all(@x) ~~ Int }) { say @x }; my @a = 1, 2; my @b = 3, 4; f @a, @b; 13:20
camelia rakudo-moar 6afd0b: OUTPUT«[1 2 3 4]␤»
moritz psch: that's my understanding as well
DrForr_ Then the documentation needs fixing. /me looks for his repo.
dogbert17 o/ #perl6
moritz todo() just says "look, I know the next test is gonna fail, don't worry about it" 13:21
\o dogbert17
dogbert17 hello moritz
grrr, there is still some kind of precompilation problem with the docs
today I have made two commits to Map.pod, the first is on thw web but the second is not 13:22
DrForr_ Ah, I didn't look closely enough at the example. My fault. 13:23
Tushar mortiz: yes I can use slurpy. but then how can i seperate the slurpy array into original arrays because I want to do element wise multiplication. I hope this make sense.
iH2O "grrr" isnt that nick already in use? 13:24
gfldex Tushar: please note that type checks happen at runtime. All you do is moving error messages around. That can be very useful ofc. 13:25
moritz Tushar: well, if you want them separate, don't use slurpies
Tushar: also, please look again at how my name is spelled :-)
iH2O grrroritz 13:26
:)
dogbert17 iH20: I wouldn't be surprised
gfldex Tushar: also there is likely an operator for what you want to do 13:27
Tushar Sorry moritz. Thanks for your help.
nine ugexe: ping
dogbert17 I have tried to debug the precomp problem a bit, can anyone take a look at gist.github.com/dogbert17/7b3fc5bf...abc3f8bbd9 13:30
dogbert17 if I read the printout correctly it seems to figure out that the precomped file is too old ... 13:32
DrForr_ Might there be a use-case for sub skip-subtest {} # Skips whatever subtests are inside? Useful if you want to report that you're not going to run test code just *yet*.
dogbert17 but when prcompiling it comes to the conclusion that it is not necessary to precompile and loads the old file instead
or I have misunderstood just about everything 13:33
DrForr_ Specifically sub skip-subtest( &sub, $message ) { skip $message }
El_Che DrForr_: How was yapc::na? I heard you gave a talk 13:36
DrForr_ Three actually. 13:36
El_Che busy bee
grammars?
DrForr_ One keynote (well, 10 minutes of one), one regex and one web framework. 13:37
El_Che I have watched a few talks on youtube, but yours wasn't there yet
DrForr_ They both were there last time I looked, let me check.
El_Che I have the url, so I'll look, no worries 13:38
DrForr_ They're not in the 'Uploads' portion of the site, that apparently still only has things pre-2016... odd, that. 13:39
DrForr_ www.youtube.com/watch?v=W1iTkACkbcM and www.youtube.com/watch?v=KxnRc0hbuBI 13:41
El_Che Did liz give a talk?
DrForr_ Not this time that I recall, though I could have just missed her in the schedule. 13:44
lizmat No, I haven't given a talk, but I do have a sore throat from answering questions to people in the Hallway track :-) 13:51
DrForr_ lizmat: Same here :/ And the dry air on the planes didn't help... 13:56
nebg can nowadays perl6 be used to do anything ? or it's still in a phase which additional development is needed... i mean can i do system programming of GUI programs ? 14:00
or web app ? 14:01
hello camelia !!
you are the butterfly right ?
gfldex nebg: there are still bugs and it's a tad slow, but beside that, there is no reason not to use it 14:02
nebg gfldex, which are the bugs ?
gfldex, ok so it has bindings for various widget toolkits like tk or wxwidgets or qt or gtk ? right ?
dogbert17 believes that he's managed to identify the doc precomp problem, working on PR 14:03
moritz nebg: rt.perl.org/ has all the bugs
gfldex nebg: there are bindings to gtk, qt will be a tricky tho 14:04
nebg gfldex, why ? 14:16
so what perl6 can be used for now ? 14:17
i mean which is the main application ? 14:18
gfldex nebg: see en.wikipedia.org/wiki/Name_mangling
DrForr_ nebg: It's a programming language. You can use it for whatever you like. 14:19
nebg DrForr_, ok
but some programming language are more suited for some fields 14:20
dalek c/fix-for-issue-545: 780b2b3 | (Jan-Olof Hendig)++ | htmlify.p6:
Fix for issue github.com/perl6/doc/issues/545

In order to speed up the doc generation the program precompiles pod files into the directory precompiled. The code in the sub extract-pod loads the precompiled files but if it detects that a pod file has been changed it calls the method precompile in CompUnit::PrecompilationRepository. The problem is that the precompile method checks if the file, that it is being asked to recompile, exists in the repo, and if it does it won't recompile it unless the named parameter :force is set to True. My suggested change is that we set :force => True when calling the precompile method.
14:21
dogbert17 my first code PR - github.com/perl6/doc/pull/636 14:23
DrForr_ nebg: That may be the case, but perl6 has been out in the wild for just over 6 months and doesn't have Apple or Google splattering its name everywhere. We've got web platforms, asynch and multicore processing, easy native library bindings, GUIs like Gtk, surely there's something that interests you. 14:24
nebg ok thanks DrForr_
gfldex nebg: if you would tell us why you asked those questions, we may be able to use that context to guess what you mean.
nebg !camelia
is it a bot ?
gfldex m: say "I'm a bot!"; 14:25
camelia rakudo-moar 6afd0b: OUTPUT«I'm a bot!␤»
nebg wow great !
travis-ci Doc build passed. Jan-Olof Hendig 'Fix for issue github.com/perl6/doc/issues/545 14:34
travis-ci.org/perl6/doc/builds/140222273 github.com/perl6/doc/commit/780b2b3d51d9 14:35
Util timotimo: (in re: Fortune's_algorithm) You could translate Math::Geometry::Voronoi, which is in Perl 5, XS, and raw C language. 14:39
m: say "!tob a llits m'I".flip; 14:44
camelia rakudo-moar 6afd0b: OUTPUT«I'm still a bot!␤»
nine ugexe: Getting really, really close now: github.com/rakudo/rakudo/commit/21...38c3e26520 14:53
ugexe: bootstrapping panda works with that, but installation of Inline::Perl5 fails because it cannot find its resources 14:55
dalek c/fix-for-issue-545: 627fa39 | (Jan-Olof Hendig)++ | htmlify.p6:
Make change more canonical. zoffix++
14:59
ugexe nine: Indeed, I added pretty much that same deprecation bit to zef's Distribution object and it has been working perfectly (including Inline::Perl5). The only other things I changed was A) passing in a relative IO path object for sources (so it would stringify to the relative path when written to the meta but grab the correct file when accessed via IO methods) and B) prefixing `resources/` to the keys of what 15:05
was being passed in to the %resources hash (but again as an IO object)
nine: can you gist the dist file that gets written for you for Inline::Perl5? 15:06
nine ugexe: gist.github.com/niner/1bf758f72522...36d3ab3e5e 15:08
ugexe hmm i wonder if panda passes in the resources as an absolute path 15:09
nine Don't see anything about that in the source 15:12
But....it's quite hot in here. Brane refuses to operate at capacity...
ugexe nope it passes a relative path object. so maybe the CWD of it changes... will need to look. I've been explicit with it instead of relying on chdir: IO::Path.new($_.value.IO.relative($!path), :CWD($!path)) 15:13
nine likes explicitness 15:14
ugexe annoyingly verbose but I think there was a good reason
dalek c: 780b2b3 | (Jan-Olof Hendig)++ | htmlify.p6:
Fix for issue github.com/perl6/doc/issues/545

In order to speed up the doc generation the program precompiles pod files into the directory precompiled. The code in the sub extract-pod loads the precompiled files but if it detects that a pod file has been changed it calls the method precompile in CompUnit::PrecompilationRepository. The problem is that the precompile method checks if the file, that it is being asked to recompile, exists in the repo, and if it does it won't recompile it unless the named parameter :force is set to True. My suggested change is that we set :force => True when calling the precompile method.
15:47
c: 627fa39 | (Jan-Olof Hendig)++ | htmlify.p6:
Make change more canonical. zoffix++
c: 9e8455b | (Zoffix Znet)++ | htmlify.p6:
Merge pull request #636 from perl6/fix-for-issue-545

Fix for issue github.com/perl6/doc/issues/545
ugexe nine: is there a way to make the back compat shim work for both of these cases? 15:50
m: role Foo { submethod new(*%_) {class :: { has $.bar; }.new(|%_)} }; say Foo.new(bar => 1).bar; class Foo2 is Foo {}; say Foo2.new(bar => 2).bar 15:51
camelia rakudo-moar 0e4a64: OUTPUT«1␤Method 'bar' not found for invocant of class 'Foo2'␤ in block <unit> at <tmp> line 1␤␤»
Woodi what is reverse of push ? 16:09
huf pop?
Woodi huf: works, thanx :) 16:10
ugexe I'm not sure its worth putting a backwards compat shim there if its not backwards compat in all common cases. Distribution.new is covered, but anything that originally inherited from Distribution will still be broke
that COMPOSE { } phaser would come in handy about now 16:11
lizmat ugexe: don't we have the functional equivalent of that already ? 16:13
forget what it was exactly...
ugexe from what I remember trying you can just put such code into the body of the role, but that doesn't help if its a role being punned into a class and you don't want that code to run *unless* its being composed as a role 16:14
Woodi so, pop is faster then @a = @a[^11] and that is faster then splice(@a,*-1). but probably it should be that way 16:15
timotimo yeah, pop is very cheap. especially since our arrays don't shrink, only grow 16:26
ugexe if being fully backwards compat is a concern it may be better to rename the distribution interface to Distribution::Installable, and leave the old Distribution as is but with a `also does Distribution::Installable; also does Distribution::Locally; method meta { self.hash; };` 16:28
pmurias_ jnthn: do you think implementing 'use oo :final, :closed' for nqp-js is a sane approach? 16:29
jnthn pmurias: I'm not sure. It depends if it is to be interpreted as having hint or enforcement semantics. I'm also somewhat doubtful about whether it's worth it on Moar, and similar may be true of the JVM too. 16:38
jnthn pmurias: In terms of my architectural vision for things, it's likely that Rakudo will do *less* compile time inlining in the future; probably only inlining of native-y things will survive. 16:41
pmurias: It just works out better to leave it to the VM, which can do it in the hot places and stands a better chance of preserving stack traces etc.
Do you have particular benefits in mind? 16:42
kalkin- m: subset Year of UInt | Dateish | Range; my Year $y = 2001..2015; 16:53
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of "|" in expression "subset Year of UInt | Dateish | Range" in sink context (line 1)␤Type check failed in assignment to $y; expected Year but got Range (2001..2015)␤ in block <unit> at <tmp> line 1␤␤»
kalkin- I don't understand the error.
Am I using | wrong?
what is a sink context?
Zoffix kalkin-, it means the value wasn't used anywhere 16:57
m: 2
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 2 in sink context (line 1)␤»
Zoffix kalkin-, I'm not even sure what that subset is supposed to be. Any of those values? 16:57
kalkin- Zoffix: yes
Zoffix m: subset Year of Any where UInt | Dateish | Range; my Year $y = 2001..2015;
camelia ( no output )
kalkin- I "fixed it" by replacing '|' with '||'
Zoffix hm 16:58
m: subset Year UInt || Dateish || Range; my Year $y = 2001..2015;
camelia rakudo-moar da5278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3subset Year7⏏5 UInt || Dateish || Range; my Year $y = ␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement e…»
Zoffix m: subset Year of UInt || Dateish || Range; my Year $y = 2001..2015;
camelia rakudo-moar da5278: OUTPUT«Type check failed in assignment to $y; expected Year but got Range (2001..2015)␤ in block <unit> at <tmp> line 1␤␤»
Zoffix Doesn't seem fixed :)
jnthn That parses as (subset Year of UInt) || Dateish || Range 16:59
Zoffix Thought so :)
jnthn subset Year where UInt | Dateish | Range; is the right way
Zoffix You don't need even need an of?
kalkin- Hmm actually my code looks a lttile bit different Dateish and Range are custom subsets which are defined like YearRnage of Range where ...
jnthn No, defaults to `of Any`
Zoffix Oh, TIL. jnthn++ 17:00
kalkin-, should still work
Zoffix ( FWIW perl6.party/post/Perl-6-Types--Made-for-Humans ) 17:00
kalkin- jnthn, Zoffix thanks 17:01
pmurias jnthn: I intend to use do it only for the JavaScript backend, MoarVM can optimize stuff at runtime, when you have the access to the types of things 17:06
jnthn: on js I don't really have controll how the V8 JIT optimizes things
pmurias jnthn: my plan is that if I can finalize and close nqp classes combined with the relatively simple (compared to Perl 6) semantics of NQP I could make rakudo.js and nqp.js compile code really fast 17:08
jnthn pmurias: Only thing is, it's an application level pragma, meaning that you'd need some way to have it take effect in modules loaded by that top-level application... 17:14
(So it's not a legal thing to write into a module, really)
(Which can be dealt with of course, but it's a complication) 17:16
pmurias yes, I would have to have too passes over everything 17:17
s/too/2
hankache m: say Bool ~~ Int
camelia rakudo-moar da5278: OUTPUT«True␤»
hankache what is the rationale behind this?
why is Bool an Int? 17:18
mst because lots of stuff uses 0/1 for booleans
hankache ok 17:19
m: sub x returns Int {return True}; x; 17:20
camelia ( no output )
hankache m: sub x returns Int {return True}; say x;
camelia rakudo-moar da5278: OUTPUT«True␤»
jnthn Also because Bool is an enum, and enums are (by default) Ints endowed with extra powers 17:21
hankache can I somehow force the type constraint to be only Int?
hankache so that the above code fails 17:23
jnthn Could try something like: subset OnlyInt where .WHAT === Int 17:24
hankache thanks 17:24
gfldex m: subset OnlyInt of Int where .WHAT === Int; sub x(\c) returns OnlyInt {return c}; say Int; say True; 17:25
camelia rakudo-moar da5278: OUTPUT«(Int)␤True␤»
gfldex m: say True.WHAT === Int;
camelia rakudo-moar da5278: OUTPUT«False␤»
hankache m: subset OnlyInt of Int where .WHAT === Int; sub x returns OnlyInt {return True}; say x; 17:26
camelia rakudo-moar da5278: OUTPUT«Type check failed for return value; expected OnlyInt but got Bool (Bool::True)␤ in sub x at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
hankache great! thanks everyone
jnthn gfldex: Did you mean those to be `say x(Int); say x(True);`? :) 17:28
Dinner time & 17:29
gfldex i did 17:31
CIAvash `where` topicalizes without a block? 17:53
psch m: my Int $x where .say = 5 17:55
camelia rakudo-moar da5278: OUTPUT«5␤»
kalkin- So as far as I understand subset Foo where A | B | C is same as subset F where * ~~ any(A|B|C) ? 18:14
gfldex yes 18:15
well, the consequence is the same
kalkin- ok if so what is subset Bar _of_ B?
Because previously i tried to do subset Foo of A | B | C, which was wrong 18:16
gfldex NYI 18:17
maybe after next christmas
kalkin- gfldex: ok NYI, but what does this mean in Perl6?
i mean the _of_ not NYI
gfldex in fact sub(A|B $x){} would be nice to have
jnthn We can't really have it though, 'cus it's ambiguous with the capture syntax in signatures 18:19
gfldex think of `of B` as a superclass of A without introducing a complete new class
kalkin- m: subset Foo of Int, Str;
camelia ( no output )
kalkin- m: subset Foo of Int, Str; my Foo $f = 'asd'; 18:20
camelia rakudo-moar da5278: OUTPUT«Type check failed in assignment to $f; expected Foo but got Str ("asd")␤ in block <unit> at <tmp> line 1␤␤»
jnthn A subset type is a refinement type. `of` has to be followed by the name of the type you wish to refine (default is Any); where is followed by the condition.
Note that after `of` we parse preceisely one type name, *not* an expression
kalkin- So i can't refine multiple types at once, which kind of makes sense. I see…
jnthn So subset Foo of A | B means (subset Foo of A) | B (e.g. the B has nothing to do with the subset type).
Which I think warned... I'm a little said that the comma case didn't warn, we should be able to catch that also 18:21
TimToady comma should distribute the sink
kalkin- jnthn: in case of '|' the warning is more confusing, then helpful
TimToady m: 42, Str 18:22
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (lines 1, 1)␤»
TimToady m: Str, 42
jnthn kalkin-: How so? It tells you something didn't get used.
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (lines 1, 1)␤»
TimToady looks like it's skipping the Str
kalkin- m: subset Foo of Int | Str;
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of "|" in expression "subset Foo of Int | Str" in sink context (line 1)␤»
kalkin- m: subset Foo of Int , Str;
camelia ( no output )
jnthn If it didn't warn it'd silently do the wrong thing...
As the , case does
TimToady m: subset Foo of Int, 42
camelia rakudo-moar da5278: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (lines 1, 1)␤»
jnthn TimToady: Hmm. I think you know that bit of the code better than I do these days ;)
TimToady I fear so :) 18:23
kalkin- so theoretically something like might be possible some day: multi subset Foo of A; multi subset Foo of B; ? 18:23
TimToady what the heck would it mean?
kalkin- TimToady: the same i tried to achieve with subset Foo of A | B; It would mean that Foo has two superclasses. 18:24
gfldex m: subset Foo of any(A,B);
camelia rakudo-moar da5278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'any'. Did you mean 'Any'?␤at <tmp>:1␤------> 3subset Foo of any7⏏5(A,B);␤»
kalkin- TimToady: or may be i', just talking bs
TimToady and my Foo $object .= new instantiates itself how?
kalkin- TimToady: hmm how does it work in case of subset Foo where (A|B) ? (might be I misunderstand some thing basic) 18:25
TimToady generally you should be mixing roles together like this, not classes
in that case, it uses the (single) of type
gfldex subset creates a new type object. That can be used as a type contraint, but there are other uses as well. 18:26
kalkin- TimToady: but as far as I understand there is no my Foo $object .=new in case of subset Foo where (A|B), or is there?
gfldex having a junction would break the other uses
TimToady m: say (subset Foo where Int | Str).of
camelia rakudo-moar da5278: OUTPUT«Method 'of' not found for invocant of class 'Foo'␤ in block <unit> at <tmp> line 1␤␤»
TimToady m: subset Foo where Int | Str; my Foo $x .= new; say $x.WHAT 18:27
camelia rakudo-moar da5278: OUTPUT«You cannot create an instance of this type (Foo)␤ in block <unit> at <tmp> line 1␤␤»
jnthn The key thing to note is that the `where` part is just used to smartmatch against; it's opaque to the type system
TimToady seems like it could instantiate the of type as a base type
jnthn Whereas the `of` part is used in things like candidate sorting
TimToady m: say (subset Foo of Cool where Int | Str).of 18:28
camelia rakudo-moar da5278: OUTPUT«Method 'of' not found for invocant of class 'Foo'␤ in block <unit> at <tmp> line 1␤␤»
TimToady m: say (subset Foo of Cool where Int | Str).^of
camelia rakudo-moar da5278: OUTPUT«Method 'of' not found for invocant of class 'Perl6::Metamodel::SubsetHOW'␤ in block <unit> at <tmp> line 1␤␤»
TimToady m: say (subset Foo of Cool where Int | Str).^methods
camelia rakudo-moar da5278: OUTPUT«Method 'methods' not found for invocant of class 'Perl6::Metamodel::SubsetHOW'␤ in block <unit> at <tmp> line 1␤␤»
jnthn Not meta enough ;)
m: say (subset Foo of Cool where Int | Str).HOW.^methods
camelia rakudo-moar da5278: OUTPUT«Method 'gist' not found for invocant of class 'NQPRoutine'␤ in block <unit> at <tmp> line 1␤␤»
jnthn Aww
Not meta-circular enough :P 18:29
m: say (subset Foo of Cool where Int | Str).HOW.^method_table.keys
camelia rakudo-moar da5278: OUTPUT«(add_stash name set_name accepts_type nominalize BUILD set_why WHY set_shortname refinee set_of shortname type_check find_method refinement new new_type archetypes)␤»
TimToady you'd think you could .of somethin' with an 'of'
jnthn TimToady: That'd mean putting the `of` up in Mu, no?
psch m: subset Foo of Int; Foo.^refinee.say 18:30
camelia rakudo-moar da5278: OUTPUT«(Int)␤»
jnthn I think it's right at the meta-level, though .^of and .^where would be welcome aliases of .^refinee and .^refinement
psch +1
grondilu in HN today there was a mention of "parsing with derivatives". I did not know about that so I looked it up. Found myself watching a Standford video about it and got surprised as the speaker mentioned Perl 6. His name is Matthew Might. Is he hanging around here? www.youtube.com/watch?v=ZzsK8Am6dKU
jnthn Anyway, example of what I meant on the multi thing 18:31
m: subset Foo where 42; multi x(Int) { 'a' }; multi x(Foo) { 'b' }; say x(42)
camelia rakudo-moar da5278: OUTPUT«a␤»
jnthn m: subset Foo of Int where 42; multi x(Int) { 'a' }; multi x(Foo) { 'b' }; say x(42)
camelia rakudo-moar da5278: OUTPUT«b␤»
TimToady should probably not be let anywhere near a computer today, after getting only a couple hours of sleep 18:32
grondilu (Perl 6 is mentioned at around 20:45)
TimToady we got up at 4 to catch an airplane, which broke, and delayed us 3 hours
jnthn Hope it managed to break while you were still on the ground?
TimToady yes, but they eventually put us onto a different plane 18:33
jnthn Phew :)
TimToady and gave that plane to the people flying to Philadelphia
jnthn I'm sure they were thrilled... 18:34
jnthn is mostly tired from the unreasonably hot weather 18:35
It broke a couple of records yesterday 18:36
(Of the "hottest 24th June in location X" style)
dalek c: c3de8f2 | (Jan-Olof Hendig)++ | doc/Type/Instant.pod:
Added docs for Instant.Date
18:37
gfldex jnthn: the rain has arived here in south eastern germany about 20min ago. Will be with you shortly. :) 18:38
jnthn \o/
nine jnthn: still so hot up there? There's been massive thunderstorms north of the Chech border already a couple hours ago
jnthn We had about 10 minutes worth of hail earlier. Still waiting on the real rain that was forecast to show up. 18:38
Zoffix kalkin-, subset Foo where Bar | Moo | Meow; is the same as subset Foo of Any where Bar | Moo | Meow; is the same as subset Foo of Any where * ~~ Bar | Moo | Meow; is the same as subset Foo of Any where { $_ ~~ Bar | Moo | Meow }; is the same as subset Foo of Any where { $_ ~~ any(Bar, Moo, Meow) };. The reason your subset Foo of Bar|Moo|Meow wasn't working is because you were applying the `of` to the constraints rather than the type you wanted to 18:40
constrain.
kalkin- Zoffix: Huge thanks for the elaborate explanation. 18:41
nine jnthn: looks like the pre-frontal wave missed you barely. The cold front is now at the German/Chech border and will probably reach you in 2-3 hours. 18:45
jnthn I'll look forward to the...uh...full-frontal???...wave then I, guess. :P 18:49
Grr, it's still too warm to get this blog post written. 18:50
nine jnthn: maybe watching Portugal - Croatia is just the better idea right now ;) 18:51
jnthn gives up for now in favor of icecream and seeing if Croatia can put Ronaldo in a bad mood again...
Heh :)
raiph bisect: use experimental :macros; macro polo ($ast) { quasi { say 42; say {{{ $ast }}} } }; polo 11 18:59
bisectable raiph: no build for such “bad” revision. Right now the build process is in action, please try again later or specify some older “bad” commit (e.g. bad=HEAD~40)
AlexDaniel bisect: bad=HEAD~10 use experimental :macros; macro polo ($ast) { quasi { say 42; say {{{ $ast }}} } }; polo 11 19:04
bisectable AlexDaniel: on both starting points the exit code is 0 and the output is identical as well
AlexDaniel bisect: use experimental :macros; macro polo ($ast) { quasi { say 42; say {{{ $ast }}} } }; polo 11
bisectable AlexDaniel: on both starting points the exit code is 0 and the output is identical as well
AlexDaniel raiph: I was wondering who would be the first one to stumble upon this error message :) 19:05
AlexDaniel Zoffix: “Perl 5 didn't have types” – I'm not sure if that is true… 19:07
nine Perl 5 does have a couple of types. They're just not as fine grained. 19:09
geekosaur perl5's types are certainly much weaker
AlexDaniel sure-sure, but there's a huge leap from that to “perl 5 does not have types” 19:10
raiph AlexDaniel++ # bisectable 19:11
Zoffix AlexDaniel, what is that from? 19:14
AlexDaniel Zoffix: perl6.party/post/Perl-6-Types--Made-for-Humans 19:15
Zoffix AlexDaniel, what types does Perl 5 have?
AlexDaniel Zoffix: well, perldata and perlintro claim that there are scalars, arrays and hashes 19:16
Zoffix :/ 19:17
Zoffix ignores this conversation and returns to hacking
AlexDaniel huggable: dunno
huggable AlexDaniel, ¯\_(ツ)_/¯
raiph bisect: use experimental :macros; macro a { quasi {{{ 42 }}} }; a 19:31
bisectable raiph: on both starting points the exit code is 0 and the output is identical as well
raiph m: use experimental :macros; macro a { quasi {{{ 42 }}} }; a
camelia rakudo-moar d4a0e0: OUTPUT«Weird node visited: QAST::BVal␤»
AlexDaniel raiph: this is only 2015.12..HEAD, perhaps you're looking for earlier changes? 20:04
raiph AlexDaniel: I just wondered if it had ever worked. I searched RT for a matching bug and didn't find one. 20:05
Well, worked without the warning I mean
kalkin- Say i have a class Foo in lib/Foo.pm6 and class Bar is Foo in lib/Foo/Bar.pm6 now i want to get all the classes existing in namespace Foo::, how do I do that? 20:25
I already tried Foo::.keys() but this doesn't return me the class
moritz m: class Foo::Bar { }; say Foo.HOW.keys 20:26
camelia rakudo-moar d4a0e0: OUTPUT«0..0␤»
moritz m: class Foo::Bar { }; say Foo.WHO.keys
camelia rakudo-moar d4a0e0: OUTPUT«(Bar)␤»
moritz m: class Foo::Bar { }; say Foo.WHO.values 20:27
camelia rakudo-moar d4a0e0: OUTPUT«((Bar))␤»
moritz m: class Foo::Bar { }; say Foo::.values
camelia rakudo-moar d4a0e0: OUTPUT«((Bar))␤»
moritz kalkin-: .keys will return the names, not the type objects
kalkin- moritz: Hmm here locally it doesn't return the class
moritz kalkin-: what does it return? 20:28
kalkin- Two other classes which don't inherite from Foo
moritz kalkin-: well, it gives you everything in the Foo:: namespace
independently of where it comes from, and of inheritance
kalkin- I do: Foo; class Foo::Bar is Foo {} in lib/Foo/Bar.pm. so it should be in Foo namespace shouldn't it? 20:29
or is Foo not a namespace because it's also the class name? 20:30
moritz it should be, yes 20:35
but using Foo; doesn't autoamtically import Foo::Bar
moritz you have to explicitly "use Foo::Bar" when Foo::Bar is in Foo/Bar.pm 20:36
kalkin- here example where it doesn't work github.com/kalkin/Foo.git 20:45
kalkin- The test.pm6 only returns Buz 20:45
but no Bar
Zoffix looks like .htaccess fix for LE didn't take. 20:46
on docs.perl6.org
moritz seems I forget to create a cron job for let's encrypt :( 20:49
running it manually now
slooooow
(the official client at least) 20:50
I should switch to simp_le, which works a bit smoother on another server I use
Zoffix: certificate renewed 20:51
Zoffix moritz++ 20:53
kalkin- Ok i think i found my problem. To extend Bar with Foo, i need to do use Foo; in lib/Foo/Bar.pm6, but then i can not have use Foo::Bar in lib/Foo.pm6--which would it make visible for Foo::.keys()-because it creates a circular dependency. 20:56
dogbert17 The owner of doc.perl6.org has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website. 21:11
moritz dogbert17: I've just renewed the certificate 21:12
dogbert17 moritz: will it take some time for Firefox to pick it up?
moritz dogbert17: a reload should be enough
dogbert17 all my browsers complain, IE, FF and Chrome 21:13
Zoffix dogbert17, try pressing CTRL+F5
moritz dogbert17: check your system clock 21:14
Zoffix oh :D
moritz Valid from Sat, 25 Jun 2016 19:50:00 UTC
moritz if your clock is half an our off, it might not be valid yet for you :-) 21:14
(or time zone wrongly configured, or something like that) 21:15
dogbert17 must be Win 7 playing ticks on me, time is 23:15
dogbert17 s/ticks/tricks/ 21:15
mst FF on win10 is totally happy
dogbert17 it works i my Virtualbox
moritz www.ssllabs.com/ssltest/analyze.ht...Results=on is happy too
dogbert17 ok, so the fault is with me then :( 21:16
moritz dogbert17: I guess it'll work again tomorrow 21:20
if not, worth inestigating further
dogbert17 moritz: you're probably right. I can still view the site if I ignore the browser complaints 21:25
Xliff m: class A { ... }; sub f(A $n) { $n.data = 1 }; class A { has $.data is rw; method new { f(self) } }; say A.new.data 21:29
camelia rakudo-moar d4a0e0: OUTPUT«Cannot look up attributes in a type object␤ in method new at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
Xliff Is self not defined in new()?
If so, how can I call an initializing routine on an object at creation time? 21:30
Zoffix m: class Foo { method new { say self } }; Foo.new
camelia rakudo-moar d4a0e0: OUTPUT«(Foo)␤»
Zoffix Xliff, it's a type, not the object yet. You need bless
Xliff m: class A { ... }; sub f(A $n) { $n.data = 1 }; class A { has $.data is rw; method new { f(self.bless) } }; say A.new.data 21:32
camelia rakudo-moar d4a0e0: OUTPUT«Method 'data' not found for invocant of class 'Int'␤ in block <unit> at <tmp> line 1␤␤»
Zoffix You need to return the object from .new. Right now you're returning 1 :) 21:34
(the object being what .bless gives you)
m: class A { ... }; sub f(A $n) { $n.data = 1; }; class A { has $.data is rw; method new { given self.bless { f $_; $_ }} }; say A.new.data 21:35
camelia rakudo-moar d4a0e0: OUTPUT«1␤»
Zoffix m: class A { ... }; sub f(A $n) { $n.data = 42; }; class A { has $.data is rw; submethod BUILD { f self } }; say A.new.data 21:36
camelia rakudo-moar d4a0e0: OUTPUT«42␤»
Xliff Hrm. I'm running into a chicken and egg problem. 22:15
Xliff (╯°□°)╯︵ ┻━┻ 22:35
Zoffix (╯°□°)╯︵ ┻━┻(╯°□°)╯︵ ┻━┻(╯°□°)╯︵ ┻━┻(╯°□°)╯︵ ┻━┻(╯°□°)╯︵ ┻━┻(╯°□°)╯︵ ┻━┻
Xliff, github.com/zoffixznet/perl6-Acme-GiveUp 22:36
Xliff HAHAHAHA! 22:39
Yeah. I'm close to that.
This "self.bless(xmlNewText($text.Str))" is giving me this: "Too many positionals passed; expected 1 argument but got 2" 22:40
WTF?
Xliff m: say 1234.Str 22:40
camelia rakudo-moar d4a0e0: OUTPUT«1234␤»
Xliff m: say 1234.Str.WHAT 22:41
camelia rakudo-moar d4a0e0: OUTPUT«(Str)␤»
Xliff :S 22:51
I didn't need self.bless -- LOL!
Zoffix heh 22:54
m: class Foo { method new { 31337 } }; say Foo.new.is-prime # .new doesn't return a Foo then tho
camelia rakudo-moar d4a0e0: OUTPUT«True␤»
Zoffix m: class Foo { method new { 31337 } }; say Foo.new.^name 22:55
camelia rakudo-moar d4a0e0: OUTPUT«Int␤»
Xliff How do you specify multiple conditions for a "when" statement?
Xliff m: given 42 { when any(^31) { say "Heave" }; when 42 { say "Ho" } } 22:56
camelia rakudo-moar d4a0e0: OUTPUT«Ho␤»
Xliff m: given 42 { when any(42, 31, 0) { say "Heave" }; when 1 { say "Ho" } } 22:57
camelia rakudo-moar d4a0e0: OUTPUT«Heave␤»
Xliff m: given 42 { when [42, 31, 0] { say "Heave" }; when 1 { say "Ho" } }
camelia ( no output )
Xliff m: given 42 { when 42|31|0 { say "Heave" }; when 1 { say "Ho" } }
camelia rakudo-moar d4a0e0: OUTPUT«Heave␤»
Xliff Hrm.
Zoffix m: given 42 { when 42 or 32 { say "Heave" }; when 1 { say "Ho" } } # also works 22:58
camelia rakudo-moar d4a0e0: OUTPUT«Heave␤»
tbrowder docs: please check another attempt PR: github.com/perl6/doc/pull/637 23:00
Zoffix m: given 42 { when $_ == 42 or $_ == 3 { say "Heave" }; when 1 { say "Ho" } } # also works 23:01
camelia rakudo-moar d4a0e0: OUTPUT«Heave␤»
Zoffix tbrowder, what are the actual changes of this happening? github.com/perl6/doc/pull/637/file...e4d3cbR295 23:03
Seems this doesn't belong in the docs.
s/changes/chances/; 23:04
Zoffix Such a change would literally break every piece of Perl 6 code I ever wrote. The benefits would have to be enormous for such a change to make it into the language. 23:06
tbrowder First, such a change would not be a catastrophe IMHO (and I don't write decls with a space). Next, I'm approximately paraphrasing TimToady when he acknowledged the problem with the space after the function name in the call (he may not have meant the decl would change). At this time I don't think it's too early to toss in a warning about the chance of such 23:15
a change. Finally, if it ever happens, I assume that there may be a way to not break existing code by some kind of environment variable, or pragma, or some such.
Xliff \o/
Xliff OK. Now I can take a bit of a break. BBL. 23:16
Zoffix There's no change. I don't understand why we need warnings or even think about pragmas and environmental variables. 23:20
tbrowder, did the conversation with TimToady happen here or in person? 23:21
This is just a good way to start a rumor that sub foo () {} is a bad idea and the next thing you know it's in a style guide because TimToady said there's a problem "with the space after a function call and he may not have meant the decl would change" 23:22
tbrowder Zoffix: in person (in a hall conversation), and he will probably smack me if he ever sees me again, but that's what I heard; however, if this causes such turmoil I will certainly remove it. (But you don't ever expect to see deprecations over the life of P6?) 23:27
Zoffix tbrowder, I don't expect us to plan for removal of an essential syntax of the language for no apparent reason. There's no problem I'm aware of with a space before parameters. 23:30
Zoffix runs a grep to see how much code would break 23:31
tbrowder Okay.
Zoffix, please check the PR now and see if that will fly. 23:34
Zoffix tbrowder, looks good, thanks.
tbrowder My pleasure! 23:35
Zoffix Based on the May 3rd snapshot of the ecosystem, such a change would break 280 distributions. 23:39
Zoffix huggable, grep ecosystem :is: How many dists use `foo`: Change the grep regex for what you're looking for: cd $(mktemp -d); git clone github.com/moritz/perl6-all-modules .; grep -REl '(method|sub|multi)\s+\S+\s+\(' . | perl -nE 'say join "/", (split "/")[1,2]' | sort | uniq | wc -l 23:40
huggable Zoffix, Added grep ecosystem as How many dists use `foo`: Change the grep regex for what you're looking for: cd $(mktemp -d); git clone github.com/moritz/perl6-all-modules .; grep -REl '(method|sub|multi)\s+\S+\s+\(' . | perl -nE 'say join "/", (split "/")[1,2]' | sort | uniq | wc -l
tbrowder Zoffix: how did you get Wendy's brochure? It's great to put in the docs repo--can we get the pdf version linked on the docs home page? 23:54
parabolize tbrowder: github.com/wendyga/Perl6Brochure
tbrowder yes, I know the source, but IMHO it needs to be mention on the docs home page (shall I make a PR?) 23:56
mscha m: my @a = 4,5,6; my @b = (1,2,3, flat @a); say @b; 23:59
camelia rakudo-moar d4a0e0: OUTPUT«[1 2 3 (4 5 6)]␤»
parabolize I think Zoffix got brochure from the source and made a pdf of it
mscha How do I fix this? (I want [1 2 3 4 5 6])