Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-16

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 japhb pTk is a *p*ortable version of the Tk part of TCL/TK.  It was made so that people could do perl5 + Tk
00:00 timotimo oh
00:00 timotimo so the tcl portion ripped out and bound via XS?
00:01 japhb yeah, with a bunch of magic because Tk *really* didn't expect that particular ripping apart.
00:01 timotimo hah
00:01 timotimo i can imagine that
00:01 timotimo i'm not sure i'd be excited for any Tk to be ported to perl6
00:01 timotimo it's just ... it's tk! :P
00:01 japhb Uh, no.
00:01 japhb This was far more interesting in the 90's than today.  :-)
00:04 timotimo have you followed opengl in the recent years?
00:04 timotimo and looked at vulkan at all yet?
00:05 japhb I stopped watching OpenGL closely around the mid-3.x period
00:06 japhb Basically, I don't know any 3D artists, and don't have time to become one myself, so an engine without cool content becomes kinda boring after your third or fourth one.  :-)
00:06 timotimo 'k
00:06 timotimo yeah, i can really imagine ;(
00:07 timotimo just today i looked at godot; there's a silly benchmark that just spawns a bunch of bunnies that bounce around the screen like bouncy balls
00:08 japhb Heh
00:08 japhb Today I recommended a very good graphics theory book to someone, and they said "Yeah, the person who wrote that was my thesis advisor"
00:09 japhb Talk about a deflating retort ...
00:09 timotimo and i apitraced it and it turns out it generates vector arrays for every single one of them and pushes them to the driver
00:09 timotimo on the way redundantly setting state over and over again
00:09 japhb Eww.
00:10 timotimo http://t.h8.lv/godot_apitrace.png
00:10 timotimo that's the better part, there's worse parts :)
00:10 japhb Oh dear
00:11 japhb There are extensions (and heck, base APIs) for that ...
00:11 timotimo yes, absolutely
00:11 timotimo this targets OpenGL ES 2, iiuc
00:11 japhb Oh ah.
00:12 japhb Yeah, ES 2 is barely in the shader era
00:12 japhb Lots of stuff people expect just isn't there.
00:12 timotimo oh, is that so?
00:12 timotimo that's rough :\
00:13 japhb I remember when ES 2 came out, wondering if I should get into handheld engine development, and then realizing if I did it on Android I'd have to do it in Java, and going "Nope, not gonna happen."
00:14 timotimo you don't have to; you can do it in C or C++
00:14 japhb timotimo: Yes, now.
00:14 timotimo ok that may be new
00:14 japhb IIRC at the time that was not so well supported.
00:14 japhb That was years ago.
00:17 geekosaur even back then people were playing with android programming with other jvm languages (I recall helping someone figure out clojure for it)
00:18 geekosaur and, hm, something else that ended up being a non-starter because the runtime glue was too big and they hadn't worked out a way to minimize to the stuff absolutely needed yet
00:18 timotimo scala?
00:18 geekosaur no
00:19 cdg joined #perl6
00:21 timotimo well, mobiles are an "interesting" target for game development anyway, because the fill rates are just so abysmal on typical hardware
00:21 timotimo so overdraw is ridiculously costly
00:21 skink You ever write something, and not really know why you wrote it?
00:22 skink $ dd if=/dev/urandom bs=1 count=8 of=/tmp/bin
00:22 skink $ p6-pgp-words /tmp/bin
00:22 skink wallet concurrent python vacancy ...
00:23 vendethiel joined #perl6
00:24 BenGoldberg joined #perl6
00:25 * geekosaur can think of reasons for what that appears to be doing...
00:25 geekosaur although count=8 seems rather low entropy :p
00:28 skink The PGP wordlist is a set of 512 words, representing each byte in odd and even positions
00:28 skink Phonologically distinct, so you can transmit a key or fingerprint spoken
00:32 timotimo neat
00:32 geekosaur international radio phonetic alphabet for pgp keys, cute >.>
00:34 skink I decided to make a Crypt::Misc to just throw random crap in
00:35 BenGoldberg joined #perl6
00:39 timotimo Cryptic Mist
00:41 nbrown joined #perl6
00:44 timotimo ... helps to compile moarvm with an --optimize higher than 0
00:47 cdg joined #perl6
00:53 wamba joined #perl6
00:55 skink You know it's quality when you've got a 520-line module that's literally just a lookup table
00:57 arlenik joined #perl6
00:58 skink (Fun fact: the fastest library for interpreting HTML involves over 20k lines of hand-written lookup tables)
00:58 arlenik I have a function that takes an argument whose type should only be of TypeA or TypeB.  What would the signature of that function look like?
00:59 psch m: sub f($a where Int|Str) { $a }; f 5; f "foo"; f 5.4
00:59 camelia rakudo-moar a45224: OUTPUT«Constraint type check failed for parameter '$a'␤  in sub f at /tmp/E77i0CBgCC line 1␤  in block <unit> at /tmp/E77i0CBgCC line 1␤␤»
01:00 psch hm, is that compile time foiling me?
01:00 psch i'd think so...
01:00 psch m: sub f($a where Int|Str) { $a }; f 5; f "foo";
01:00 camelia rakudo-moar a45224: ( no output )
01:00 matiaslina joined #perl6
01:00 psch arlenik: anyway, generally that's the pattern
01:00 psch arlenik: the alternative is declaring a subset that fits exactly your two types
01:01 psch m: subset StrInt of Any where Int|Str; sub f(StrInt $) { }; f "foo"; f 5
01:01 camelia rakudo-moar a45224: ( no output )
01:01 arlenik psch: thanks. What if the functio had two arguments with the same exact constraints.  Is there anyway to apply the constraint to both arguments without repeating 'where TypeA|TypeB' for both?
01:01 psch arlenik: although then you'd have to cheat (as i did) a bit
01:02 psch as in, a subset needs a base type first, and that base type can be constraint further
01:02 arlenik psch: ok, i see. thanks very much.
01:02 psch in my example, i'm using Any, which is our "root type", as in what everything inherits from if there's no specific parent type
01:03 psch alternatively you could probably just create a new class that inherits from both of your allowed types
01:03 psch unless they conflict in some manner
01:03 psch m: class C { }; class D { }; class E is C is D { }; sub f(E $) { }; f C.new; f D.new
01:03 camelia rakudo-moar a45224: OUTPUT«Type check failed in binding <anon>; expected E but got C (C.new)␤  in sub f at /tmp/nU0VgIJk2D line 1␤  in block <unit> at /tmp/nU0VgIJk2D line 1␤␤»
01:04 psch oh, no
01:04 * psch is actually not great with OOP vOv
01:04 psch maybe it'd work with subsets or some role shennanigans...
01:07 ZoffixWin Your E would fit into a C or D restriction, not the other way around.
01:07 psch oh, right
01:07 ZoffixWin m: class C { }; class D { }; class E is C is D { }; sub f(C $) { }; sub x(D $) { }; f E.new; x D.new
01:07 camelia rakudo-moar a45224: ( no output )
01:10 psch m: class C { }; sub f(C $x, $y where *.isa($x.WHAT)) { }; f C.new, C.new # another somewhat weird way
01:10 camelia rakudo-moar a45224: ( no output )
01:10 psch hm, i wonder if that can be parameterized...
01:10 psch eh, no need, actually
01:10 psch but the semantics are somewhat different anyway i suppose
01:11 psch because that one means $y has to be of $x type or a subtype of the type of $x
01:11 psch m: say Int.isa(Any)
01:11 camelia rakudo-moar a45224: OUTPUT«True␤»
01:18 molaf_ joined #perl6
01:24 timotimo m: say 9.9e0.Int
01:24 camelia rakudo-moar a45224: OUTPUT«9␤»
01:32 skink m: subset MyTypeA of Str where *.chars > 1; subset MyTypeB of Int where 1..10; sub thingy ($thing where MyTypeA|MyTypeB) { say $thing }; thingy 4
01:32 camelia rakudo-moar a45224: OUTPUT«4␤»
01:33 kid51 joined #perl6
01:34 skink Ah, yeah, psch has the shorter, cheatier way
01:34 skink arlenik, Does the function do different things depending on the input type? You may be able to use a multi sub
01:37 BenGoldberg m: my ([$a]); $a.WHAT.say
01:37 camelia rakudo-moar a45224: OUTPUT«Cannot call method 'say' on a null object␤  in block <unit> at /tmp/FMj7GpxRQj line 1␤␤»
01:37 BenGoldberg m: my ([$a]); say $a.WHAT
01:37 camelia rakudo-moar a45224: OUTPUT«(Mu)␤»
01:38 * BenGoldberg wonders why it's Mu instead of Any.
01:38 BenGoldberg m: Mu.say
01:38 camelia rakudo-moar a45224: OUTPUT«(Mu)␤»
01:38 BenGoldberg m: my Mu $a; $a.say;
01:38 camelia rakudo-moar a45224: OUTPUT«(Mu)␤»
01:47 adhoc joined #perl6
01:59 MasterDuke joined #perl6
02:09 MasterDuke joined #perl6
02:09 BenGoldberg m: my @a; say @a.splice: 0, 1;
02:09 camelia rakudo-moar a45224: OUTPUT«[]␤»
02:09 BenGoldberg m: my @a; say @a.shift;
02:09 camelia rakudo-moar a45224: OUTPUT«Cannot shift from an empty Array␤  in block <unit> at /tmp/_S4v8hLWS1 line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/_S4v8hLWS1 line 1␤␤»
02:10 pecastro joined #perl6
02:12 BenGoldberg joined #perl6
02:17 ZoffixWin m: my @a = [],; say @a.shift;
02:17 camelia rakudo-moar a45224: OUTPUT«[]␤»
02:18 BenGoldberg m: my @a; say @a.shift;
02:18 camelia rakudo-moar a45224: OUTPUT«Cannot shift from an empty Array␤  in block <unit> at /tmp/AMtIHyCI_d line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/AMtIHyCI_d line 1␤␤»
02:18 BenGoldberg m: [].shift;
02:18 camelia rakudo-moar a45224: OUTPUT«Cannot shift from an empty Array␤  in block <unit> at /tmp/ZufodnO_Bg line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/ZufodnO_Bg line 1␤␤»
02:18 BenGoldberg What's wrong with shifting from an empty array?
02:19 ZoffixWin What would you return?
02:19 BenGoldberg What if I'm happy getting an (Any) or whatever?
02:19 ZoffixWin m: my @a = Any,; say @a.shift;
02:19 camelia rakudo-moar a45224: OUTPUT«(Any)␤»
02:19 ZoffixWin it can be a legit element inside of an array and now you have an ambiguity
02:19 ZoffixWin You can do @a and @a.shift
02:20 BenGoldberg Seems silly.
02:20 ZoffixWin Why?
02:20 BenGoldberg I'd also be happy with getting a failure object.
02:21 BenGoldberg Err, unless that's what it's doing?
02:21 BenGoldberg m: [].shift.WHAT.say;
02:21 camelia rakudo-moar a45224: OUTPUT«(Failure)␤»
02:21 BenGoldberg ooh
02:21 ZoffixWin :D
02:21 BenGoldberg m: so([].shift).say;
02:21 camelia rakudo-moar a45224: OUTPUT«False␤»
02:24 BenGoldberg m: https://gist.github.com/BenGoldberg1/467dff5994d16fb4af23
02:24 camelia rakudo-moar a45224: OUTPUT«2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 3…»
02:24 vendethiel joined #perl6
02:26 BenGoldberg I know a falure in sink context creates an exception... and prefixing my '@!factors.shift' with 'so' defuses this... is there a better/more idiomatic way of doing this?
02:29 pecastro joined #perl6
02:31 pecastro joined #perl6
02:36 ZoffixWin It's kinda weird there's .uniname*s* but no .uniprop*s*
02:38 pecastro joined #perl6
02:39 noganex_ joined #perl6
02:41 BenGoldberg m: https://gist.github.com/BenGoldberg1/467dff5994d16fb4af23
02:42 camelia rakudo-moar a45224: OUTPUT«In 3 seconds, produced 9779 primes, from 2 to 102103␤»
02:42 pecastro joined #perl6
02:42 BenGoldberg m: my $howlong = 3; my $end = $howlong + now; my $cnt = 0; for ( ^Inf ) { ++$cnt if .is-prime; last if now > $end }; say $cnt;
02:42 camelia rakudo-moar a45224: OUTPUT«1099␤»
02:42 * BenGoldberg grins.
02:42 BenGoldberg m: 9779 / 1099
02:42 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/peG9nMYig5:␤Useless use of "/" in expression "9779 / 1099" in sink context (line 1)␤»
02:42 BenGoldberg m: say (9779 / 1099)
02:42 camelia rakudo-moar a45224: OUTPUT«8.898089␤»
02:43 * BenGoldberg 's prime generator is almost 9x faster than repeated primality generation.
02:44 BenGoldberg Err, repeated primality testing.
02:45 pecastro joined #perl6
02:45 ZoffixWin cool
02:47 ZoffixWin m: say (^Inf .grep: *.is-prime)[0..9779]; say now - INIT now;
02:48 camelia rakudo-moar a45224: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 …»
02:48 ZoffixWin m: my $x = + eager (^Inf .grep: *.is-prime)[0..9779]; say now - INIT now;
02:49 camelia rakudo-moar a45224: OUTPUT«20.1472873␤»
02:51 sortiz_ m: my @a; with @a.shift { say "data" } else { say .DEFINITE ?? "failure" !! "undef" } ; # with is good to handle failures
02:51 camelia rakudo-moar a45224: OUTPUT«failure␤»
03:09 _notbenh joined #perl6
03:18 BenGoldberg m: (^Inf .grep: *.is-prime)[9779].say; say now - INIT now;
03:18 camelia rakudo-moar a45224: OUTPUT«(timeout)»
03:18 BenGoldberg m: (^Inf .grep: *.is-prime)[0].say; say now - INIT now;
03:18 camelia rakudo-moar a45224: OUTPUT«2␤0.00637310␤»
03:19 BenGoldberg m: (^Inf .grep: *.is-prime)[1099].say; say now - INIT now;
03:19 camelia rakudo-moar a45224: OUTPUT«8831␤1.35728061␤»
03:19 BenGoldberg m: (^Inf .grep: *.is-prime)[9000].say; say now - INIT now;
03:19 camelia rakudo-moar a45224: OUTPUT«93187␤20.1244585␤»
03:20 BenGoldberg m: say now - INIT now;
03:20 camelia rakudo-moar a45224: OUTPUT«0.00159358␤»
03:21 BenGoldberg m: (^Inf .grep: *.is-prime && now < INIT { now + 3 } )[*-1].say; say now - INIT now;
03:21 camelia rakudo-moar a45224: OUTPUT«Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?␤  in block <unit> at /tmp/7Cwhu2b0yB line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/7Cwhu2b0yB line 1␤␤»
03:21 BenGoldberg m: (^Inf .grep: { *.is-prime && now < INIT { now + 3 } } )[*-1].say; say now - INIT now;
03:22 camelia rakudo-moar a45224: OUTPUT«(timeout)»
03:23 BenGoldberg m: (^Inf .grep(*.is-prime).first: now > INIT { now + 3 } ).say; say now - INIT now;
03:23 camelia rakudo-moar a45224: OUTPUT«Cannot use Bool as Matcher with '.first'.  Did you mean to use $_ inside a block?␤  in block <unit> at /tmp/din7593oon line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/din7593oon line 1␤␤»
03:23 BenGoldberg m: (^Inf .grep(*.is-prime).first({ now > INIT { now + 3 } )).say; say now - INIT now;
03:23 camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/BNUa1cpbfa␤Missing block␤at /tmp/BNUa1cpbfa:1␤------> 3s-prime).first({ now > INIT { now + 3 } 7⏏5)).say; say now - INIT now;␤    expecting any of:␤        statement end␤        statement modi…»
03:23 ZoffixWin I wonder why this times out: m: (^Inf .grep: { *.is-prime && now < INIT { now + 3 } } )[*-1].say; say now - INIT now;
03:23 ZoffixWin Ah
03:23 BenGoldberg Cause it's ^Inf.grep
03:23 ZoffixWin Precedence
03:24 ZoffixWin Oh
03:24 ZoffixWin OK
03:24 BenGoldberg It's never going to create an end-of-list condition
03:24 ZoffixWin Right
03:24 ZoffixWin m: (^Inf .grep: { *.is-prime and now < INIT now + 3 } )[*-1].say; say now - INIT now;
03:25 camelia rakudo-moar a45224: OUTPUT«(timeout)»
03:25 BenGoldberg m: my @naive := ^Inf .grep: *.is-prime; my $f = @naive.first: now > INIT now + 3;
03:26 camelia rakudo-moar a45224: OUTPUT«(timeout)»
03:26 BenGoldberg m: my @naive := ^Inf .grep: *.is-prime; my $f = @naive.first: now > INIT (now + 3);
03:26 * BenGoldberg shrugs
03:26 camelia rakudo-moar a45224: OUTPUT«(timeout)WARNINGS for /tmp/JFqjN12hv3:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤»
03:27 cpage_ joined #perl6
03:27 BenGoldberg m: my @naive := ^Inf .grep: *.is-prime; my $f = @naive.first: (now > INIT (now + 3));
03:28 camelia rakudo-moar a45224: OUTPUT«(timeout)WARNINGS for /tmp/YeFnSptnqR:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤»
03:28 BenGoldberg m: my @naive := ^13 .grep: *.is-prime; my $f = @naive.first: (now > INIT (now + 3));
03:28 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/iGf5g3txYU:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤Type check failed in binding; expected Positional but got Seq ((2, 3, 5, 7, 11).Seq)␤  in block <unit> at /tmp/iGf5g3txYU line 1␤␤»
03:28 BenGoldberg m: my @naive := ^13 .grep: *.is-prime; my $f = @naive.first: { now > INIT (now + 3) };
03:28 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/K1MDjvy0_r:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤Type check failed in binding; expected Positional but got Seq ((2, 3, 5, 7, 11).Seq)␤  in block <unit> at /tmp/K1MDjvy0_r line 1␤␤»
03:28 BenGoldberg m: my @naive := ^13; my $f = @naive.first: { now > INIT (now + 3) };
03:28 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/cs7jtG2_tl:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤»
03:29 BenGoldberg m: my @naive := ^13 .grep: True; my $f = @naive.first: { now > INIT (now + 3) };
03:29 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/6GO2CTxrQm:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤Earlier failure:␤ Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?␤  in block <unit> at /tmp/6GO2CTxrQm line 1␤␤Fi…»
03:29 BenGoldberg m: my @naive := ^13 .grep: .so; my $f = @naive.first: { now > INIT (now + 3) };
03:29 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/eJSB0BwKMj:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤Earlier failure:␤ Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?␤  in block <unit> at /tmp/eJSB0BwKMj line 1␤␤Fi…»
03:29 BenGoldberg m: my @naive := ^13 .grep: *.so; my $f = @naive.first: { now > INIT (now + 3) };
03:29 camelia rakudo-moar a45224: OUTPUT«WARNINGS for /tmp/pxZRbAvokI:␤Useless use of "+" in expression "now + 3" in sink context (line 1)␤Type check failed in binding; expected Positional but got Seq ((1, 2, 3, 4, 5, 6, 7,...)␤  in block <unit> at /tmp/pxZRbAvokI line 1␤␤»
03:29 BenGoldberg m: 1.so.say
03:29 camelia rakudo-moar a45224: OUTPUT«True␤»
03:30 BenGoldberg m: my @naive := ^13 .grep: *.so;
03:30 camelia rakudo-moar a45224: OUTPUT«Type check failed in binding; expected Positional but got Seq ((1, 2, 3, 4, 5, 6, 7,...)␤  in block <unit> at /tmp/PF1i9JVKnA line 1␤␤»
03:30 BenGoldberg huh
03:30 BenGoldberg m: my @naive := flat ^13 .grep: *.so;
03:30 camelia rakudo-moar a45224: OUTPUT«Type check failed in binding; expected Positional but got Seq ((1, 2, 3, 4, 5, 6, 7,...)␤  in block <unit> at /tmp/j9d3mDmDCQ line 1␤␤»
03:30 BenGoldberg m: my @naive := eager ^13 .grep: *.so;
03:30 camelia rakudo-moar a45224: ( no output )
03:30 [Coke] aigh.
03:31 BenGoldberg m: my \naive = ^13 .grep: *.so;
03:31 camelia rakudo-moar a45224: ( no output )
03:32 BenGoldberg m: my \naive := ^13 .grep: *.is-prime; my $f = naive.first: { now > INIT {now + 3} };
03:32 camelia rakudo-moar a45224: ( no output )
03:32 BenGoldberg m: my \naive := ^13 .grep: *.is-prime; say naive.first: { now > INIT {now + 3} };
03:32 camelia rakudo-moar a45224: OUTPUT«Nil␤»
03:32 BenGoldberg m: my \naive := ^Inf .grep: *.is-prime; say naive.first: { now > INIT {now + 3} };
03:32 camelia rakudo-moar a45224: OUTPUT«15581␤»
03:32 [Coke] m: say " Gentle reminder, dear reader, that you can use camelia with private messages."
03:32 camelia rakudo-moar a45224: OUTPUT« Gentle reminder, dear reader, that you can use camelia with private messages.␤»
03:42 skink What's the Perl6 syntax for a value I don't care about? e.g. 'let _ = whatever' in OCaml
03:43 Timbus $ = whatever()
03:44 Timbus https://doc.perl6.org/language/variables#The_%24_Variable
03:48 [Coke] $ isn't quite nothing, it's an anonymous state variable.
03:48 [Coke] skink: if you don't care about it, don't save it in a variable.
03:49 skink I had a given $x, $y where True, False and True, True did the same thing
03:49 skink So I wanted True, _ for that case basically
03:52 Timbus so I think you want Any ?
03:54 pecastro joined #perl6
03:55 pecastro joined #perl6
04:02 skink Oh, hm
04:02 skink If I include a script in bin/ with a module, does it not see the same ?%RESOURCES as the modules?
04:02 skink %? *
04:03 SalamiTactics joined #perl6
04:07 aries_liuxueyang joined #perl6
04:07 aries_liuxueyang Hello, everyone.
04:08 aries_liuxueyang I have a question: `my $a; my $b; $b := $a;` this can be run in script. but it can not be run on repl.
04:08 aries_liuxueyang whey.
04:08 aries_liuxueyang why
04:12 [Coke] works fine in my repl.
04:12 [Coke] what does your "perl6 --version" say?
04:13 aries_liuxueyang `This is Rakudo version 2016.03-119-ga452244 built on MoarVM version 2016.03-108-gca1a21a
04:13 aries_liuxueyang implementing Perl 6.c.`
04:13 aries_liuxueyang this error: `===SORRY!=== Error while compiling <unknown file>
04:13 aries_liuxueyang Cannot use bind operator with this left-hand side
04:13 aries_liuxueyang at <unknown file>:1`
04:14 [Coke] Are you doing anything other than typing "perl6" and then typing in that line between the `` on a single line on the REPL?
04:15 aries_liuxueyang I type one line a time by hand.
04:16 Cabanossi joined #perl6
04:16 [Coke] I can duplicate that error message if I hit enter after each of the ;
04:17 aries_liuxueyang Yes, I hit enter after each of the ;
04:18 aries_liuxueyang why? does it because of the repl?
04:18 skids joined #perl6
04:18 [Coke] I don't know exactly what the root cause there is, but in general, the REPL isn't quite the same as running a script. the context as you go from line to line isn't quite the same.
04:20 aries_liuxueyang okay, thanks.
04:22 aries_liuxueyang besides, anyone use vim? my vim can not show syntax highlight
04:22 aries_liuxueyang my vim version is 7.4
04:29 [Coke] I do, but I don't use syntax highlighting, usually. You probably want: https://github.com/vim-perl/vim-perl/blob/master/syntax/perl6.vim
04:29 nige1 joined #perl6
04:29 [Coke] Note that it's so old it references a VM we no longer use, so it might be out of date.
04:32 aries_liuxueyang [Coke]: thank you, I have seen that and will have a try now ;-)
04:51 mr-foobar joined #perl6
05:13 BenGoldberg joined #perl6
05:27 pecastro joined #perl6
05:35 rurban joined #perl6
05:42 [Coke] m: say nativecast.WHAT
05:42 camelia rakudo-moar a45224: OUTPUT«5===SORRY!5=== Error while compiling /tmp/anO1BgKLLX␤Undeclared routine:␤    nativecast used at line 1␤␤»
05:42 [Coke] nativecast is referenced in the NativeCall doc
06:05 wamba joined #perl6
06:08 cognominal_ joined #perl6
06:09 Vlavv_ joined #perl6
06:10 CIAvash joined #perl6
06:17 aries_liuxueyang [Coke]: did you use Pathogen to install vim-perl?
06:19 [Coke] It was so long ago, I have no idea, sorry
06:19 [Coke] I presume I did whatever the README told me.
06:21 aries_liuxueyang it's weird and it does not start to work by Pathogen way.
06:22 aries_liuxueyang Maybe I can try another way. thank you. ;-)
06:31 cognominal joined #perl6
06:32 Cabanossi joined #perl6
06:43 jjido joined #perl6
06:48 rindolf joined #perl6
06:49 ZoffixWin I'm guessing there's something special with exceptions when the caller is a sub in .nqp file? Looking at #127883 and see a call from load_module() in src/Perl6/World.nqp is involved.
06:50 ZoffixWin m: CompUnit::RepositoryRegistry.head.need( CompUnit::DependencySpecification.new( :short-name<Foo> ) );
06:50 camelia rakudo-moar a45224: OUTPUT«Could not find Foo in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repository::AbsolutePath<140328410…»
06:50 ZoffixWin ^ and that does have a line number, but with `use Foo`, there's no line number
06:52 rurban joined #perl6
06:55 ZoffixWin Screw it. Over my head.
06:59 azawawi joined #perl6
06:59 azawawi hi
06:59 azawawi ZoffixWin: ping
06:59 ZoffixWin pong
07:00 azawawi ZoffixWin: my mind is attached to my email. i just woke up :)
07:00 ZoffixWin lol
07:01 azawawi ZoffixWin: re no line number info, it is evident a lot  when using atom perl6 editor tools plugin
07:01 azawawi ZoffixWin: generally the error is at line number 0 which is the default for undefined line numbers
07:01 azawawi ZoffixWin: or line 1
07:02 azawawi ZoffixWin: the problem occur on scripts or not one liners also
07:03 ZoffixWin It occurs with one liners too
07:03 ZoffixWin There's no line info at all.
07:03 azawawi i see
07:04 KotH joined #perl6
07:09 azawawi ZoffixWin: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L2378 ... we're not passing line number information?
07:10 azawawi ZoffixWin: something like https://github.com/rakudo/rakudo/blob/nom/src/Perl6/World.nqp#L609
07:10 ZoffixWin ¯\_(ツ)_/¯ it's over my head. I gave up :)
07:11 azawawi i bet we need to handle the exception inside the grammar instead of instead of the world
07:11 azawawi s/instead of//
07:12 azawawi and that's what happens when you dont drink your morning coffee :)
07:12 moritz or pass $/ to world
07:12 azawawi moritz: good morning
07:12 moritz so that it knows the line number
07:12 moritz azawawi: \o
07:13 azawawi $*LINE_NO is not set though. that's is passed using $/ ?
07:13 azawawi my nqp foo is weak, master :)
07:15 ZoffixWin load_module() actually has my $line   := self.current_line($/); but $line isn't used anywhere in it
07:16 moritz azawawi: what do you mean by "it's not set though"? Is it set to an undefined value? Or is there a place where it's NQPMu or something?
07:19 azawawi moritz: ignore my comment. im just woke up :)
07:19 azawawi moritz: s/im/i/
07:22 * azawawi starts a rakudo fork to try to fix it :)
07:25 ZoffixWin m: ."\b\b\b\b\b\b"()
07:25 camelia rakudo-moar a45224: OUTPUT«Method '' not found for invocant of class 'Any'␤  in block <unit> at /tmp/WXndyRcnbX line 1␤␤»
07:26 ZoffixWin .oO( camelia ain't a terminal... )
07:26 vendethiel joined #perl6
07:27 vendethiel masak: are you sure you know me? :P
07:31 Ven joined #perl6
07:42 ZoffixWin wow, Proxy is cool
07:44 CIAvash joined #perl6
07:44 ZoffixWin m: my $s = 0; my $v := Proxy.new( FETCH => method () { $s }, STORE => method ($new) { $s = ^25 .pick } ); .say for ++$v, $v; say $v; .say for ++$v, $v;
07:44 camelia rakudo-moar a45224: OUTPUT«6␤6␤6␤19␤19␤»
07:45 * ZoffixWin contemplates a text web browser using a Proxy... :P
07:45 ZoffixWin To go to a URL, you assign it to a variable and to view the results you simply read it
07:45 ZoffixWin Wait. That's the simplest LWP::Simple! :o
07:46 jack_rabbit joined #perl6
07:57 xfix joined #perl6
08:02 firstdayonthejob joined #perl6
08:03 ocbtec joined #perl6
08:19 darutoko joined #perl6
08:24 ZoffixWin m: (sub (FatRat) {})(class FatCat{});
08:24 camelia rakudo-moar a45224: OUTPUT«Type check failed in binding <anon>; expected FatRat but got FatCat (FatCat)␤  in sub  at /tmp/kYUx5sVasF line 1␤  in block <unit> at /tmp/kYUx5sVasF line 1␤␤»
08:24 ZoffixWin ????
08:27 masak vendethiel: enough to make the "hug a stranger" punchline ;)
08:33 _mg_ joined #perl6
08:35 RabidGravy joined #perl6
08:38 RabidGravy harr
08:40 hankache joined #perl6
08:43 * masak ponders how compatible server-side events are with Bailador and PSGI
08:45 RabidGravy the WebSocket module is a PSGI app thingy
08:45 masak ooh https://metacpan.org/pod/distribution/PSGI/PSGI.pod#Delayed-Response-and-Streaming-Body
08:45 RabidGravy you can alternatively return a Channel instead of content from a PSGI app
08:46 masak yes, this is what I want
08:46 masak finally a chance to use Channels! :D
08:46 RabidGravy :)
08:47 RabidGravy be a love amd make a an EventSource *client* too, I want to rip this rubbish implementation out of Sofa soon
08:47 masak m: sub (FatRat) {}(class FatCat{})
08:47 camelia rakudo-moar a45224: OUTPUT«Type check failed in binding <anon>; expected FatRat but got FatCat (FatCat)␤  in sub  at /tmp/9NBeKEEHAT line 1␤  in block <unit> at /tmp/9NBeKEEHAT line 1␤␤»
08:47 masak ZoffixWin: no need for that first set of parentheses
08:47 masak RabidGravy: my client is in JS, though.
08:48 RabidGravy :-\ BOO
08:55 masak heh
08:58 masak hm, only Bailador::Test mentions p6sgi.streaming... and it sets it to Bool::False
08:58 masak ufobat: ...halp :)
09:00 jjido_ joined #perl6
09:14 RabidGravy I'd make a quick example but I haven't had a coffee yet
09:15 azawawi RabidGravy: Greetings from non-coffee land
09:15 RabidGravy :-O
09:15 Relsak joined #perl6
09:39 dogbert17 hello #perl6
09:42 dogbert17 continuing my documentation spree, it seems as if only about 75 % of the methods in Cool have been documented at this point ;(
09:42 dogbert17 on the plus side there is some low hanging fruit to be found here I think
09:44 moritz dogbert17: many of the methods have been documented in the classes where the more specific variant lives
09:44 moritz for example, .uc coerces to Str, so .uc is documented in Str
09:44 lizmat joined #perl6
09:45 dogbert17 does that mean that we shouldn't document it in cool, I guess the difference is coercion of the invocant?
09:46 dogbert17 Stuff like that would be low hanging fruit but perhaps it doesn't have to go into Cool
09:47 moritz dogbert17: it can be documented in Cool, we'll just duplicate lots of stuff that way
09:48 dogbert17 True, should I try to look at other methods instead, i.e. stuff that is not documented elsewhere?
09:48 RabidGravy I guess one could knock up a quick script to find all the methods in cool that aren't over-ridden by sub-classes
09:49 RabidGravy also there are probably some that are over-ridden by some sub-classes and not others
09:49 moritz dogbert17: and if ou haven't seen it yet, the Cool docs have a table of which method  coerces to what type
09:49 moritz extendind that would be the real LHF
09:50 moritz dogbert17: yes, documenting stuff that hasn't been documented at all would be more beneficial
09:50 RabidGravy I guess documenting *all* the methods in Cool would be a boon for anyone who had a desire to sub-class it themself for some reason
09:51 dogbert17 moritz: I actually added a few methods to that table yesterday
09:51 dogbert17 and removed one as well ... capitalize
09:53 moritz dogbert17: ok, great
09:53 moritz just shows how much I'm out of the loop :/
09:54 dogbert17 found a changelog claiming that capitalize was removed in 2013
09:54 CIAvash joined #perl6
09:55 moritz yes, wordcase is the new capitalize
09:55 dogbert17 I'll snoop around a bit in the docs, find something that is not documented, and then pester you with a suggestion :-)
09:56 vendethiel joined #perl6
09:58 spider-mario joined #perl6
10:00 Ven joined #perl6
10:01 moritz dogbert17: have you looked into the issue tracker?
10:03 dogbert17 no (blushes)
10:03 dogbert17 rt.perl.org ?
10:04 moritz https://github.com/perl6/doc/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+is%3Aopen+label%3A%22needs+writing%22
10:04 dogbert17 thanks, will take a look
10:05 moritz dogbert17: some of them might be outdated (so the doc might already exists), do a git grep before actualling documenting stuff
10:07 dogbert17 actually found one that should be closed, i.e. already implemented, https://github.com/perl6/doc/issues/113
10:08 moritz dogbert17: will you close it, or should I?
10:09 dogbert17 can I close it?
10:09 dogbert17 I'll try :-)
10:10 moritz dogbert17: if you can push to the repo, you can also close issues
10:10 moritz dogbert17: if it doesn't work, tell me
10:11 dogbert17 done :-)
10:11 moritz dogbert17++
10:18 masak RabidGravy: I'd really appreciate a quick example of SSE.
10:25 dpk left #perl6
10:30 azawawi https://github.com/azawawi/rakudo/commit/c1b6e84b6648404bc0648997dea92c749dc2ced2  # First attempt at fixing RT #127883
10:32 azawawi feedback is welcome
10:38 moritz azawawi: I find $.line as the attribute a bit short
10:39 dogbert17 do these suggested doc additions seem correct or am I in over my head? https://gist.github.com/dogbert17/6deed8b9776bacb444b18faaae08ebf1
10:39 moritz what kind of line is it?
10:39 azawawi $.line-number ?
10:39 moritz source-line-number?
10:39 moritz dunno
10:40 moritz dogbert17: the first three are good; the others not so much (more)
10:40 azawawi moritz: i used the same conventions as X::Comp
10:40 Ven joined #perl6
10:40 moritz azawawi: yes, but in an exception, it's a bit clearer IMHO what it refers to
10:40 dogbert17 argh
10:41 moritz dogbert17: coercion to Int is not soething that Int actually implements
10:41 moritz dogbert17: it's more like, several types that implement Cool do it in a different way
10:41 azawawi moritz: ok... fixing ... thanks for the feedback
10:41 moritz for example Str.Int parses the str, Array.Int looks at the number of elements
10:42 * lizmat waits for azawawi++ to make changes and then will merge the PR
10:42 dogbert17 ah, I'd better remove these for the time being :-) got three right at least
10:44 dogbert17 my proficiency in perl6 is still a bit sketchy, that's why I'm trying to find LHF
10:50 dogbert17 one more question, Cool.pod documents a routine called EVALFILE but that does not show up when typing 'say Cool.^methods'. What am I missing here?
10:51 vendethiel joined #perl6
10:53 lizmat dogbert17: EVALFILE is a sub
10:54 dogbert17 lizmat: thx
11:08 azawawi lizmat: first green https://travis-ci.org/rakudo/rakudo/builds/123540811 :)
11:09 dalek doc: d8a76bd | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
11:09 dalek doc: Added chomp, chop and codes to the method coercion table
11:09 dalek doc: review: https://github.com/perl6/doc/commit/d8a76bddbf
11:09 kid51 joined #perl6
11:10 pecastro joined #perl6
11:10 lizmat azawawi: I had already tested it myself...  :-)  so it's merged now
11:10 azawawi lizmat: supercomputer machine? :)
11:11 lizmat naaah...  combination of looking at code and seeing it compiles  :-)
11:13 * azawawi dreams of http://ark.intel.com/products/85766/Intel-Xeon-Processor-E5-4669-v3-45M-Cache-2_10-GHz
11:16 travis-ci joined #perl6
11:16 travis-ci Doc build errored. Jan-Olof Hendig 'Added chomp, chop and codes to the method coercion table'
11:16 travis-ci https://travis-ci.org/perl6/doc/builds/123541890 https://github.com/perl6/doc/compare/8e218cfb9d1d...d8a76bddbfe4
11:16 travis-ci left #perl6
11:16 dogbert17 nooooo
11:17 lizmat azawawi: hmmm... some places don't specify the line number  :-(
11:17 azawawi spectest?
11:18 dogbert17 so how do I figure out what went wrong here, I could build the docs locally
11:18 azawawi lizmat: EVAL?
11:18 lizmat not sure yet
11:21 dogbert17 strange, it complains that it couldn't build panda ?!?
11:25 jeek joined #perl6
11:25 lizmat azawawi: there are about 6 test files that fail with source-line-number being required: I made it optional for now
11:25 azawawi ok :)
11:25 dogbert17 as a newbie it's not obvious to me why a change in doc/Type/Cool.pod could lead to a build failing with the msg 'The command "rakudobrew build-panda" failed and exited with 2 during .'
11:29 lizmat dogbert17: wasn't that caused by me mergening azawawi's PR ?
11:29 lizmat *merging
11:29 dogbert17 perhaps :-)
11:31 dogbert17 it said something about   # Looks like you planned 16 tests, but ran 14, t/02-shell-command.t ..
11:31 azawawi http://pasteboard.co/ec2dlgV.png       # Finally...
11:32 lizmat if it was azawawi's PR, then it should be fixed now
11:32 rurban left #perl6
11:32 dalek perl6-most-wanted/add-bindings-for-nlp: b3fcfa3 | titsuki++ | most-wanted/bindings.md:
11:32 dalek perl6-most-wanted/add-bindings-for-nlp: Add "NLP and Machine Learning" to the list
11:32 dalek perl6-most-wanted/add-bindings-for-nlp: review: https://github.com/perl6/perl6-most-wanted/commit/b3fcfa3dad
11:33 dogbert17 it is fixed, lizmat++
11:33 azawawi lizmat: so im a core contributor? :)
11:37 lizmat azawawi: yes  :-)
11:38 psch azawawi++
11:38 azawawi :)
11:40 lizmat azawawi: would appreciate it if you could check all occurrences of DependencySpecification in roast that lack a :source-line-number parameter
11:42 * RabidGravy wonders if titsuki would also like the moon on a stick and a pony
11:44 azawawi lizmat: sure
11:44 dogbert17 The round method/sub is defined in Real and Cool but I can't find any description of which tie-breaking rule is use, i.e how to round 2.5 or -0.5, is it documented somewhere?
11:45 dogbert17 s/use/used/
11:46 psch m: say Cool.^can('round').candidates>>.signature
11:46 camelia rakudo-moar 674186: OUTPUT«Method 'candidates' not found for invocant of class 'List'␤  in block <unit> at /tmp/CwGOMQtgmG line 1␤␤»
11:46 psch m: say Cool.^can('round')>>.candidates>>.signature
11:46 camelia rakudo-moar 674186: OUTPUT«(((Cool $: *%_) (Cool $: $base, *%_)))␤»
11:46 psch m: say Real.^can('round')>>.candidates>>.signature
11:46 camelia rakudo-moar 674186: OUTPUT«Too many positionals passed; expected 2 arguments but got 3␤  in block <unit> at /tmp/844TT2hxEd line 1␤␤»
11:46 psch ah, doesn't pun there
11:46 psch m: say Real.new.^can('round')>>.candidates>>.signature
11:46 camelia rakudo-moar 674186: OUTPUT«(((Real:D $: *%_) (Real:D $: $scale, *%_)))␤»
11:46 psch m: say Cool ~~ Real; say Real ~~ Cool
11:46 camelia rakudo-moar 674186: OUTPUT«False␤True␤»
11:46 psch dogbert17: Real is Cool, so it's narrower
11:47 psch i also think :D would be narrower than no type smiley, but that doesn't matter here
11:47 jeek joined #perl6
11:52 _mg_ joined #perl6
11:58 * lizmat goes enjoying the great outdoors again
11:59 dogbert17 psch: interesting but I'm not sure how it helps me here, do the different types use different tie breaking rules https://en.wikipedia.org/wiki/Rounding#Tie-breaking
12:01 psch ohh
12:01 psch yeah, i thought tie-breaking in a MMD sense, my bad
12:02 dogbert17 nah, I should have been clearer when i posted my question
12:02 dogbert17 s/i/I/
12:03 psch dogbert17: in any case, Cool.round calls self.Numeric.round, and Real does Numeric
12:03 psch so they both essentially do the same thing, except for the fact that Cool.round first coerces to Numeric
12:03 dogbert17 psch: thanks, that's good to know
12:05 dogbert17 looks as if the rule used is 'Round half away from zero'
12:09 mane joined #perl6
12:13 azawawi .tell lizmat nothing so far but https://github.com/perl6/roast/blob/master/S11-compunit/compunit-dependencyspecification.t
12:13 yoleaux azawawi: I'll pass your message to lizmat.
12:17 molaf joined #perl6
12:21 dogbert17 Hmm, I must suffer from a serious lack of coffee, the rounding tie-breaker rule p6 uses is 'Round half up' not 'Round half away from zero' as I wrote earlier
12:23 rurban joined #perl6
12:23 dogbert17 m: say -1.5.round # this fooled me :(
12:23 camelia rakudo-moar 4b0e5b: OUTPUT«-2␤»
12:24 psch m: say (-1.5).round
12:24 camelia rakudo-moar 4b0e5b: OUTPUT«-1␤»
12:24 psch m: say -1.5 .round
12:24 camelia rakudo-moar 4b0e5b: OUTPUT«-1␤»
12:25 dogbert17 parenthesis FTW
12:25 dogbert17 psch: why did your last example return -1 ?
12:26 psch m: say -1.5\ .round
12:26 camelia rakudo-moar 4b0e5b: OUTPUT«-2␤»
12:26 psch dogbert17: there's slightly different precedence for postfix methodop and infix methodop i think
12:27 dogbert17 aha, I have a lot to learn it seems
12:29 Actualeyes joined #perl6
12:31 Ven joined #perl6
12:32 * psch finally got the chord variant stuff working
12:34 RabidGravy psch++
12:35 psch example.pl6 doesn't care about playing mode-unfitting chords, though, so sometimes there's stuff like Dminmaj7 in e.g. C major... vOv
12:38 dalek perl6-most-wanted: b3fcfa3 | titsuki++ | most-wanted/bindings.md:
12:38 dalek perl6-most-wanted: Add "NLP and Machine Learning" to the list
12:38 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/b3fcfa3dad
12:38 dalek perl6-most-wanted: 1a7abda | titsuki++ | most-wanted/bindings.md:
12:38 dalek perl6-most-wanted: Merge pull request #27 from perl6/add-bindings-for-nlp
12:38 dalek perl6-most-wanted:
12:38 dalek perl6-most-wanted: Add "NLP and Machine Learning" section to the list
12:38 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/1a7abdaaa0
12:57 RabidGravy masak, server side events https://gist.github.com/jonathanstowe/cf9178dc8d27d5e2542e1137f7137427
12:59 RabidGravy Now, that *appears* to send all that right things, but for some reason the node EventSource thingy doesn't recognise it, despite it being effectively the same response to one it *does* recognise
13:02 RabidGravy oh wait, just edited
13:03 RabidGravy that *does* work
13:04 RabidGravy now, how one might integrate that with Bailador is left as an exercise for the reader
13:24 * [Coke] waves from Baltimore.
13:25 [Coke] (documenting things duplicatively - be nice if we documented it once and then built the docs so you could see it both ways)
13:27 [Coke] "I have no idea what I'm doing" - me in about 3.5 hours
13:28 RabidGravy that's me all the time
13:29 * [Coke] wonders if baltimore has an IRC channel.
13:30 * [Coke] 's stomach is not happy about the coffee/food ratio atm.
13:33 [Coke] rjbs: let me be the first to publicly hope that your free time will now be spent hacking on Rakudo! ;)
13:35 rjbs ????
13:39 jameslenz joined #perl6
13:40 [Coke] .u ????
13:40 yoleaux No characters found
13:48 Ven joined #perl6
13:54 sue joined #perl6
13:57 kid51 joined #perl6
14:14 colomon joined #perl6
14:14 colomon timotimo: octree, actually.
14:15 * colomon thinks he can hack his way around the issue without an octree, based on looking more closely at an actual case.
14:17 Ikke_ joined #perl6
14:23 tharkun joined #perl6
14:24 CIAvash joined #perl6
14:25 skids joined #perl6
14:35 colomon O(N^2) operations are bad when N=766, m’kay?
14:43 [Coke] Nice. the Perl 6 installfest had a few people who were interested in getting perl 6 installed, but that were basically able to get it done on their own. one panda snag from a week ago that magically worked today.
14:44 BenGoldberg joined #perl6
14:45 RabidGravy wahay!
14:53 Skarsnik joined #perl6
14:55 RabidGravy Is something like "role Sofa::Document::All[::Doc = (Hash but Sofa::Document::Wrapper)] does JSON::Class {" a bit too weird?
14:57 Juerd Yes.
14:59 colomon joined #perl6
15:03 arnsholt It's definitely weird enough that it deserves an explanatory comment, but whether it's worth it or not depends on the interface you get to implement
15:07 jjido joined #perl6
15:07 masak RabidGravy: `::Doc =` -- I don't think I understand that bit. is it really two colons?
15:08 RabidGravy Really two colons, a "type capture"
15:09 RabidGravy it works, the actual API is a bit nicer :)
15:10 [Coke] Hi to the people in baltimore who are seeing #perl6 on the board.
15:10 kid51 joined #perl6
15:11 mst _   _ ___    ____    _    _   _____ ___ __  __  ___  ____  _____
15:11 mst | | | |_ _|  | __ )  / \  | | |_   _|_ _|  \/  |/ _ \|  _ \| ____|
15:11 mst | |_| || |   |  _ \ / _ \ | |   | |  | || |\/| | | | | |_) |  _|
15:11 mst |  _  || |   | |_) / ___ \| |___| |  | || |  | | |_| |  _ <| |___
15:11 mst |_| |_|___|  |____/_/   \_\_____|_| |___|_|  |_|\___/|_| \_\_____|
15:11 mst
15:12 teatime lol
15:12 * teatime has a sudden urge to watch The Wire.
15:16 kurahaupo joined #perl6
15:18 TimToady dogbert17: you apparently got warnocked yesterday..."capitalize" turned into "wordcase" quite some time ago, in part because some people can't remember how to spell it :) but mainly because tclc is just the default policy you might apply word by word
15:19 mst TimToady: like, say, you. given it's spelled 'capitalise' :D
15:19 * mst goes to fish his tea back out the harbour
15:28 ZoffixWin #perl6 on the board? What board?
15:29 mst I would presume the board in the room hosting the baltimore installathon
15:29 ZoffixWin I see
15:29 ZoffixWin Also, you misspelt 'capitalize'
15:31 sue joined #perl6
15:33 mst in soviet zoffix, ALL words spelled with Z
15:33 TimToady dogbert17: oh, I see moritz unwarnocked you, moritz++
15:33 ZoffixWin :)
15:34 rurban joined #perl6
15:34 dogbert17 TimToady: thanks for the capitali[s|z]e explanation, much appreciated
15:35 dogbert17 and I also learned the meaning of 'warnocked' :)
15:35 RabidGravy masak, did you see the gist of the really dumb SSE psgi app?
15:39 ZoffixWin m: ^0x1FFFF .grep({ .uniname ~~ m:i/web/  })».say
15:39 camelia rakudo-moar 4b0e5b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EWdvojzrDj␤Missing « or »␤at /tmp/EWdvojzrDj:1␤------> 1FFFF .grep({ .uniname ~~ m:i/web/  })».7⏏5say␤»
15:39 ZoffixWin bug?
15:42 _mg_ joined #perl6
15:45 TimToady arguable both ways :)
15:45 ZoffixWin TimToady, what's the non-bug argument?
15:46 TimToady . is an infix that is looser than ». so how is it supposed to figure out the head of that is really a method?
15:47 ZoffixWin m: (^0x1FFF).grep({ .uniname ~~ m:i/web/  })».say
15:47 camelia rakudo-moar 4b0e5b: ( no output )
15:47 TimToady when you write ^42 .grep it's really ^42 . grep
15:47 ZoffixWin Ah
15:47 TimToady so switching back from infix processing to postfix processing is a bit fraught
15:48 TimToady otoh, people think of infix . as a way to write a funny postfix, hence the argument to fix it too :)
15:48 ZoffixWin :)
15:50 BenGoldberg m: (^0x1FFF).grep({ .uniname ~~ m:i/web/  }).map: .say
15:50 camelia rakudo-moar 4b0e5b: OUTPUT«(Any)␤Cannot call map(Seq: Bool); none of these signatures match:␤    ($: Hash \h, *%_)␤    (\SELF: &block;; :$label, :$item, *%_)␤    (HyperIterable:D $: &block;; :$label, *%_)␤  in block <unit> at /tmp/ukvrre4GEy line 1␤␤»
15:51 BenGoldberg m: (^0x1FFF).grep({ .uniname ~~ m:i/web/  }).map: { .say }
15:51 camelia rakudo-moar 4b0e5b: ( no output )
15:52 * ZoffixWin is trying to find a good unicode char for "browser in a variable" thingie :)
15:54 timotimo ?????
15:54 ZoffixWin m: '????'.uninames.say
15:54 camelia rakudo-moar 4b0e5b: OUTPUT«(PERSONAL COMPUTER)␤»
15:54 ZoffixWin That doesn't display neither in my IRC client nor in my code editor :)
15:54 timotimo hehe.
15:55 TimToady you need a better ????
15:55 ZoffixWin heh
15:55 timotimo well, moar knows it, so it's not that new :)
15:56 firstdayonthejob joined #perl6
15:57 ZoffixWin m: sub term:<%????> { 42 }; say "%????[]"
15:57 camelia rakudo-moar 4b0e5b: OUTPUT«42␤»
15:57 ZoffixWin freaky :)
15:57 timotimo what's that character?
15:58 timotimo is that the personal computer?
15:58 ZoffixWin Yes
15:58 * TimToady finds it fascinating that we spent millenia trying to reduce the number of ideographs in our writing system, but now that we can look things up on a computer, we're reinventing many new ideographs
15:59 TimToady ZoffixWin: that's...freaky...yeah...
15:59 TimToady overloading sigils via LTM seems like a bad idea for some reason
16:01 TimToady m: say ${foo}
16:01 camelia rakudo-moar 4b0e5b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YQulP65Blp␤Unsupported use of ${foo}; in Perl 6 please use $foo␤at /tmp/YQulP65Blp:1␤------> 3say ${foo}7⏏5<EOL>␤»
16:01 colomon Is there a nice idiomatic way to initalize a Hash value to the empty array / list / whatever if the value doesn’t currently exist in the Hash?
16:01 TimToady though that's exactly what we're doing to get that error, I guess
16:02 grondilu m: say [1, 1] ~~ Array[Real]
16:02 camelia rakudo-moar 4b0e5b: OUTPUT«False␤»
16:03 ZoffixWin m: my %h = bar => 42; %h<foo> //= Empty; %h<bar> //= Empty; say %h;
16:03 camelia rakudo-moar 4b0e5b: OUTPUT«{bar => 42, foo => ()}␤»
16:03 ZoffixWin colomon, something like that, ^ perhaps?
16:03 ZoffixWin Hm, I guess that's "false" not "not exists"
16:03 ZoffixWin or not defined
16:04 TimToady note that .push will do something like this automagically
16:04 colomon I think it will work either way?
16:04 grondilu m: subset Metric of Array where .all ~~ Real; say [1, 1i] ~~ Metric; say [1, 2] ~~ Metric
16:04 camelia rakudo-moar 4b0e5b: OUTPUT«False␤True␤»
16:04 colomon TimToady: right, but I’m dealing with the results of a classify call, and don’t actually want to add anything else to the list, I just want the Empty list to be there.
16:05 TimToady seems a bit X/Y to me
16:05 grondilu m: subset Metric of Array where { .all ~~ Real and .map(&abs).all == 1 }; say [1, 1i] ~~ Metric; say [1, 2] ~~ Metric; say [1, -1] ~~ Metric
16:05 camelia rakudo-moar 4b0e5b: OUTPUT«False␤False␤True␤»
16:05 colomon X/Y?
16:06 TimToady S99:XY
16:06 TimToady or so
16:06 ZoffixWin colomon, x/y problem. You're trying to solve the wrong problem.
16:06 timotimo er. i need to find tuits to fix synopsebot6
16:07 synopsebot6 joined #perl6
16:07 timotimo S99:XY
16:07 synopsebot6 Link: http://design.perl6.org/S99.html#XY
16:07 RabidGravy there
16:07 timotimo S99:XY Problem
16:07 synopsebot6 Link: http://design.perl6.org/S99.html#XY_Problem
16:08 TimToady if you only want to know the existence of a key, seems more like a Set
16:08 TimToady or are you overloading two different behaviors on one structure?
16:09 colomon TimToady: okay, here’s the problem.  I have two lists of 3D coordinate systems, and a test that can classify whether or not a system is the standard global origin.  I need to know how many of the systems are the standard global origin in each list, and get a list of all the ones which are not for each list.
16:09 TimToady S99:MEGO
16:09 synopsebot6 Link: http://design.perl6.org/S99.html#MEGO
16:10 TimToady hah, found one that isn't there :)
16:11 ZoffixWin colomon, you should probably using a Set and one of those fancy set operators
16:11 ZoffixWin Check out these: http://docs.perl6.org/language/setbagmix
16:11 TimToady I suspect colomon++ already knows about those, which is why I said "seems" :)
16:12 ZoffixWin Alright :)
16:12 colomon TimToady: two different behaviors on one structure, as my longer message says.  :)
16:13 TimToady okay, though my eye gloze over
16:13 TimToady *eyes
16:15 colomon Quick version: Have list.  Need to know how many things in the list pass a test, and get a list of all the ones that fail it.
16:15 colomon … and when I put it like that, the answer is obvious.
16:15 colomon TimToady++
16:17 ZoffixWin grep for failures and subtract the number you got from original number to get successes
16:17 colomon ZoffixWin: right, like I said, obvious.
16:17 Herby_ joined #perl6
16:17 TimToady ????
16:17 Herby_ Morning, everyone!
16:17 Herby_ o/
16:18 colomon ZoffixWin++
16:19 stmuk does anyone know any SF.pm names?
16:21 cdg joined #perl6
16:22 TimToady I believe so :)
16:25 stmuk is Fred Moyer the best contact?
16:28 sue sigh, typical perl geek response. let's get breakfast
16:28 TimToady no clue; SF is on the other side of Palo Alto from me, which is too massive to transmit much
16:29 sue this is the way it works when people ask questions on the list. you get 20 different people saying they have no freaking idea
16:29 skink joined #perl6
16:29 sue CHEERS FOR THAT :-)
16:29 TimToady well, I thought one such answer was okayish
16:29 colomon There’s more than one way not to know it.
16:29 TimToady just to be social and all
16:30 * colomon got the running time for his program from 20 minutes to 45 seconds with this round of changes.  Hup!
16:30 sue i'm mostly joking
16:31 TimToady ????
16:33 skink colomon, Reminds me of this https://i.imgur.com/U3kDo3W.png
16:34 dogbert17 This usage description of sort is backwards, isn't it? sort LIST, SORT_BY
16:36 dogbert17 its from List.pod
16:36 dogbert17 Usage:
16:36 dogbert17 sort LIST
16:36 dogbert17 sort LIST, SORT_BY
16:36 dogbert17 LIST.sort
16:36 dogbert17 LIST.sort(SORT_BY)
16:37 ZoffixWin Yeah
16:37 TimToady if it's a named parameter, it doesn't matter where it goes really
16:37 timotimo the usage sections were not terribly well received and not too many of them were actually added
16:38 timotimo or reviewed for that matter
16:38 dogbert17 m: say sort &abs, (3, -4, 7, -1, 2, 0)
16:38 camelia rakudo-moar 4b0e5b: OUTPUT«(0 -1 2 3 -4 7)␤»
16:38 TimToady if it's position, then it starts mattering more :)
16:38 TimToady *tional
16:38 rurban joined #perl6
16:39 dogbert17 was thinking of changed that part of the docs
16:39 dogbert17 s/changed/changing/
16:41 dogbert17 I'll change it then :)
16:41 dogbert17 timotimo: are you a p6 profiler virtuoso?
16:42 timotimo just a little bit
16:42 timotimo what do you need?
16:42 dogbert17 do you know why this fails      perl6 --profile -e 'my @m[5]'
16:42 timotimo no, haven't looked into it yet
16:43 timotimo could be because it doesn't run any code and the profiler doesn't expect the result set to be empty
16:43 timotimo so maybe it's running into a null pointer and asplodes
16:43 colomon joined #perl6
16:44 dogbert17 the above is a golfed version [Coke]++ a 'real' program
16:45 timotimo what kind of failure are you seeing? "knowhow methods must be called on an object instance with repr KnowHOWREPR"?
16:45 timotimo and "don't know how to dump a BOOTCode"?
16:45 araujo_ joined #perl6
16:46 dogbert17 I see the first one 'knowhow ...'
16:46 timotimo i can try to look into it later today; for now i'll be AFK
16:48 araujo_ joined #perl6
16:50 araujo_ joined #perl6
16:50 dogbert17 timotimo: thx, let me now if you need the code and I'll paste it
16:52 araujo_ joined #perl6
17:03 riatre joined #perl6
17:03 zakharyas joined #perl6
17:04 wamba joined #perl6
17:04 BenGoldberg joined #perl6
17:08 dalek doc: db65e03 | (Jan-Olof Hendig)++ | doc/Type/List.pod:
17:08 dalek doc: Removed two typos and changed an inconsistency in the usage section for sort
17:08 dalek doc: review: https://github.com/perl6/doc/commit/db65e03d93
17:11 rurban1 joined #perl6
17:12 * RabidGravy renames a bunch of tests so they are numbered 100 apart
17:13 mst the skills we learned from BBC BASIC will always be with us
17:14 Skarsnik Hello
17:14 vendethiel o/
17:15 timotimo dogbert17: you can paste it right now, i'll look at it when i get to it
17:16 Emeric joined #perl6
17:17 dogbert17 timotimo: https://gist.github.com/dogbert17/c510cc424c37450c7678db8624acc66d
17:19 timotimo dogbert17: if  you're after performance, you can get a decent improvement by not using multi-dimensional arrays with fixed dimensions; those are not yet optimized at all
17:19 timotimo just drop the shape and it ought to be faster already
17:19 dogbert17 cool, will try
17:21 Ven joined #perl6
17:23 travis-ci joined #perl6
17:23 travis-ci Doc build passed. Jan-Olof Hendig 'Removed two typos and changed an inconsistency in the usage section for sort'
17:23 travis-ci https://travis-ci.org/perl6/doc/builds/123584211 https://github.com/perl6/doc/compare/d8a76bddbfe4...db65e03d930c
17:23 travis-ci left #perl6
17:23 skink Hey ZoffixWin, if have bin/script in a module, can it see %?RESOURCES?
17:24 skink you* have
17:24 ZoffixWin No idea
17:24 RabidGravy I don't think it can, but it's easy to test
17:25 timotimo just make a tiny module that just returns %?RESOURCES :P
17:25 RabidGravy yeah, that's what I've actually done
17:27 kid51 joined #perl6
17:29 RabidGravy No, just tested and it doesn't appear that they can
17:30 skink mhm
17:32 RabidGravy but as timotimo says you can just have "module MyResources { sub resources() is export { %?RESOURCES }}" in your lib and jobs a good-un
17:35 skink Yeah I can try that after fixing panda again
17:36 skink panda --force install . does not actually overwrite previous installations, even if you bump versions, so testing this is a tad annoying
17:36 RabidGravy A little gimmick I've used is https://github.com/jonathanstowe/Lumberjack-Application/blob/master/lib/Lumberjack/Template/Provider.pm
17:36 RabidGravy just specify the new version in the use
17:37 skink The script included with the module isn't using the module itself :D
17:48 ugexe it should have access to resources, afterall if you use a local module via -I its %?RESOURCES are still available to the local directory loaded copy of the module
17:49 ugexe i.e. if you can access a (possibly not-loaded) CompUnit you should be good
17:50 kid51 joined #perl6
17:52 mane joined #perl6
17:52 grondilu jeez the EVAL warning message is very dissuasive indeed.
17:52 BenGoldberg joined #perl6
17:54 ugexe perl6 -e 'EVAL()' \ "FUCK YOU!!! only kidding"
17:58 domidumont joined #perl6
18:04 djbkd joined #perl6
18:11 Ven joined #perl6
18:16 colomon joined #perl6
18:18 domidumont1 joined #perl6
18:31 kid51 joined #perl6
18:33 [Coke] "Brian Duggan"++
18:36 * colomon sort of knows a Bryan Duggan…
18:44 * [Coke] hopes he seppled this Duggan's name right - he's giving a presentaitn on writing a web app in P6.
18:45 colomon Bryan is a tech guy, but I haven’t heard anything about him working with p6, and he lives in Ireland.
18:46 [Coke] this guy is in Baltimore right now. :)
18:46 colomon :)
18:46 * [Coke] likes This presentation so much better than the one Coke did!
18:46 colomon https://itunes.apple.com/us/app/tunepal/id356935033?mt=8
18:58 [Coke] https://github.com/bduggan/hamna :)
19:07 Ven joined #perl6
19:13 BenGoldberg joined #perl6
19:18 obfusk joined #perl6
19:29 colomon joined #perl6
19:29 tharkun joined #perl6
19:31 colomon [Coke]++
19:31 dwarring joined #perl6
19:34 regreg joined #perl6
19:34 regreg hello
19:34 regreg i have a clean rakudo star installation
19:34 regreg I'm trying to run "panda install Readline"
19:34 regreg and I get a failure at the "==> Testing LibraryMake" step
19:35 regreg no such file or directory
19:35 regreg in sub run-and-gather-output at C:\rakudo\share\perl6\site\sources\5AEF9DA5AE15E5AB5CB2ADB58A455E007FA783
19:36 regreg no such file or directory   in sub run-and-gather-output at C:\rakudo\share\perl6\site\sources\5AEF9DA5AE15E5AB5CB2ADB58A455E007FA7839E line 85
19:36 djbkd joined #perl6
19:36 regreg any idea on how to proceed?
19:37 kaare_ joined #perl6
19:39 Ven joined #perl6
19:47 [Coke] which version of rakudo star?
19:47 [Coke] what OS, btw?
19:56 jjido joined #perl6
19:57 regreg windows 10 64bit
19:57 regreg rakudo-star-2016.01-x86_64 (JIT)
19:59 TimToady joined #perl6
20:00 regreg [Coke]:
20:01 jjido joined #perl6
20:04 [Coke] sorry, don't have a win box to test on at the moment. Anyone else?
20:04 colomon joined #perl6
20:05 regreg [Coke]: don't I need some sort of C compiler to install  the Readline  library? I have MSVC but probably it needs mingw- gcc
20:09 cpage joined #perl6
20:11 regreg i think i'll try perl6 in a linux vm then
20:24 mane joined #perl6
20:31 timotimo i need a beefier computer so i can play those DOS games
20:35 geekosaur regreg, if you can find a built readline.dll then NativeCall can use it directly
20:35 regreg the point of Readline library is to offer a better console wrapper i think, not to be called from code
20:36 geekosaur it needs to be called from code to provide things like intelligent completion
20:37 geekosaur rlwrap could be used to wrap an existing program (sort of; not sure that even flies on Windows) but it can't distinguish filename completion from command completion from variable completion from etc.
20:37 kid51 joined #perl6
20:45 djbkd joined #perl6
20:47 [Coke] release process will start tomorrow about 9 am eastern
21:05 [Coke] .seen dha
21:05 yoleaux I saw dha 11 Apr 2016 21:26Z in #perl6: <dha> That doesn't really look like Larry.
21:05 [Coke] dha was registered to be here at baltimore, but he's not. :(
21:11 ZoffixWin How many people are there? And is it all about P6?
21:13 Ben_Goldberg joined #perl6
21:15 AlexDaniel joined #perl6
21:19 sortiz joined #perl6
21:19 sortiz \o #perl6
21:19 ZoffixWin \o
21:24 skink Anyone know any cool/neat/weird ideas for the crypto trashbag?
21:24 skink Got a passphrase generator and the PGP wordlist convert in so far
21:28 sortiz Digging into regreg problem with in R* on Windows found that a) LibraryMake needs an environment with cl and nmake, b) as Readline don't include readline's sources, the dependency on LibraryMake is needless.
21:45 TEttinger joined #perl6
21:45 leont joined #perl6
21:50 ZoffixLappy joined #perl6
21:58 leont jnthn: Test::Harness is so bad a being parallel on Windows you might as well not use the parallelism
21:58 leont Also, I think we're one bugfix away from parallel TAP::Harness in pure-perl6
22:06 BenGoldberg joined #perl6
22:08 timotimo ooooh
22:08 timotimo leont: you got some details? :)
22:08 timotimo well, for today i promised i'd look at a profiler invocation going boom
22:09 ZoffixLappy m: role Base { has $.name = 'Base; }; role Curiosity does Base { has $.name = 'Curiosity' }; my $curi = Curiosity.new; say $curi
22:09 camelia rakudo-moar 4b0e5b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bG0GyDWpIA␤Two terms in a row␤at /tmp/bG0GyDWpIA:1␤------> 3ole Curiosity does Base { has $.name = '7⏏5Curiosity' }; my $curi = Curiosity.new; ␤    expecting any of:␤        infix␤        infi…»
22:09 ZoffixLappy TTIAR??
22:09 khw joined #perl6
22:09 leont timetime: still working on figuring out if it's rakudo or moar, I suspect the latter
22:10 leont timotimo,
22:10 ZoffixLappy Ah, damn. missing quote.
22:10 ZoffixLappy m: role Base { has $.name = 'Base'; }; role Curiosity does Base { has $.name = 'curiosity'; }; my $curi = Curiosity.new; say $curi
22:10 camelia rakudo-moar 4b0e5b: OUTPUT«Attribute '$!name' conflicts in role composition␤  in any apply at gen/moar/m-Metamodel.nqp line 1974␤  in any compose at gen/moar/m-Metamodel.nqp line 2057␤  in any specialize_with at gen/moar/m-Metamodel.nqp line 2497␤  in any  at gen/moar/m-Meta…»
22:11 ZoffixLappy How can I make it so I have a $.name I can use in the Base, but other roles (like Curiosity here) can change the value of it?
22:12 leont Proc::Async file handles don't give an EOF signal, so the Supplies never have their :done handlers called
22:13 ZoffixLappy m: role Base { method foo { say self!name } }; role Curiosity does Base { has $!name = 'Curi'; }; say Curiosity.new.foo
22:13 camelia rakudo-moar 4b0e5b: OUTPUT«No such private method '!name' for invocant of type 'Curiosity'␤  in method foo at /tmp/LPoj1_AvsP line 1␤  in block <unit> at /tmp/LPoj1_AvsP line 1␤␤»
22:13 ZoffixLappy Ah. I get it.
22:13 ZoffixLappy Never mind me :)
22:15 leont Hmmm, it seems the problem is Rakudo after all. If my suspicion is correct I have a fix :-)
22:17 sortiz m: role Base { has $.name = 'Base'; }; role Curiosity does Base { method new { self.bless(:name<curiosity>) }}; my $curi = Curiosity.new; say $curi
22:17 camelia rakudo-moar 4b0e5b: OUTPUT«Curiosity.new(name => "curiosity")␤»
22:18 ZoffixLappy Cool. Thanks.
22:22 timotimo leont: sounds great!
22:24 zakharyas joined #perl6
22:25 sortiz ZoffixLappy, When B does A, all methods and attributes of A, even private ones, are now an integral part of your class/role B.
22:29 ZoffixLappy ???? I need to read up more on that stuff later on.
22:33 ZoffixLappy Curious, is there a away to specify either-or in the signature? e.g.  sub query (Str :$sol, Str :$earth-day) { ... } and I want either $sol or $earth-day to be a required parameter.
22:33 ZoffixLappy Right now I'm just checking in the body of the sub
22:34 timotimo no, but you can build two multi candidates
22:34 ZoffixLappy ! timotimo++ right
22:44 dolmen joined #perl6
22:46 timotimo dogbert17: did you get around to writing the diagonals-sum thing without shaped arrays yet?
22:53 sortiz Some of the ideas I've been testing in DBDish for search and load of libraries at runtime, now on an independent module, not ready for ecosystem yet but for comments and discussion: https://github.com/salortiz/NativeLibs
22:54 AlexDaniel sortiz: that looks very promising
22:59 sortiz AlexDaniel, Thanks!
23:01 AlexDaniel sortiz: any reason why this cannot be built into nativecall itself?
23:11 ZoffixLappy m: sub foo (:$foo where { $_ > 0 } ) { say $foo ?? 'foo' !! 'no foo' }; foo
23:11 camelia rakudo-moar 4b0e5b: OUTPUT«Use of uninitialized value of type Any in numeric context  in block  at /tmp/nGdR66G6h_ line 1␤Use of uninitialized value of type Any in numeric context  in block  at /tmp/nGdR66G6h_ line 1␤Constraint type check failed for parameter '$foo'␤  in sub f…»
23:12 ZoffixLappy This is kinda LTA, TBH. No `foo` parameter was passed to the sub, so it shouldn't be checked for validity
23:13 leont The cycle of "change one bit, rebuild the entire prelude", repeat, repeat is a bit slow :-/
23:13 ZoffixLappy Especially since you can't `return` from within a where clause, so if you're writing neat subsets, they turn out awkward
23:14 dogbert17 timotimo: I changed my @mat[$size; $size]; to my @mat; instead but perf went down. Should I change the way I access the matrix as well?
23:15 ZoffixLappy Oh, it's actually failing the constraint ;/
23:18 ZoffixLappy m: subset Foo of Any where  { $_ ~~ Any ?? True !! ($_ > 5 or warn 'Need more than five') }; sub foo (Foo :$foo) { say $foo ?? 'foo' !! 'no foo' }; foo :2foo
23:18 camelia rakudo-moar 4b0e5b: OUTPUT«foo␤»
23:18 ZoffixLappy I can't master this. How do I define a subset for an optional named arg that also able to `warn`?
23:19 ZoffixLappy m: subset Foo of Any where  { .defined ?? ($_ > 5 or warn 'Must be more than 5') !! True }; sub foo (Foo :$foo) { say $foo ?? 'foo' !! 'no foo' }; foo :2foo
23:19 camelia rakudo-moar 4b0e5b: OUTPUT«Must be more than 5  in block  at /tmp/v9LYrPAHDk line 1␤Must be more than 5  in block  at /tmp/v9LYrPAHDk line 1␤Constraint type check failed for parameter '$foo'␤  in sub foo at /tmp/v9LYrPAHDk line 1␤  in block <unit> at /tmp/v9LYrPAHDk line 1…»
23:20 geekosaur smartmatch against Any seems wrong
23:20 geekosaur m: (5 ~~ Any).so.say
23:20 camelia rakudo-moar 4b0e5b: OUTPUT«True␤»
23:20 ZoffixLappy That's the answer ^. My original compaint still stand though. Unspecified named args should not be checked
23:21 sue joined #perl6
23:23 ZoffixLappy This can probably be addressed via module-space.
23:25 * ZoffixLappy gets cracking
23:33 colomon joined #perl6
23:33 sortiz AlexDaniel, That is the plan, after intensive testing.
23:33 AlexDaniel sortiz: cool
23:34 timotimo dogbert17: hm, dunno, should be all right
23:34 timotimo dogbert17: i put a piece of safety code in the right spot to make that code run under the profiler again
23:35 timotimo dogbert17: you can pull the very latest nqp and compile a rakudo with that, it should work then
23:36 BenGoldberg joined #perl6
23:41 timotimo dogbert17: what $size did you use to get it to actually take enough time? :)
23:42 dogbert17 timotimo: the problem calls for the size to be 1001, see https://projecteuler.net/problem=28
23:42 timotimo ouch :)
23:43 ZoffixLappy m: sub subset-is (&check, Str $message = '') { return sub ($v){ $v.defined ?? ( &check($v) or warn $message ~ " Got $v" and False ) !! True }; }; subset Positive of Int where subset-is { $_ > 0 }, "Must be a positive Int."; my Positive $x = -2;
23:43 camelia rakudo-moar 4b0e5b: OUTPUT«Must be a positive Int. Got -2  in sub  at /tmp/uRSn9hmKzP line 1␤Type check failed in assignment to $x; expected Positive but got Int (-2)␤  in block <unit> at /tmp/uRSn9hmKzP line 1␤␤»
23:43 ZoffixLappy m: sub subset-is (&check, Str $message = '') { return sub ($v){ $v.defined ?? ( &check($v) or warn $message ~ " Got $v" and False ) !! True }; }; subset Positive of Int where subset-is { $_ > 0 }, "Must be a positive Int."; sub foo ( Positive :$foos ) { }; foo foos => -2;
23:43 camelia rakudo-moar 4b0e5b: OUTPUT«Must be a positive Int. Got -2  in sub  at /tmp/KCxnFKVH0X line 1␤Must be a positive Int. Got -2  in sub  at /tmp/KCxnFKVH0X line 1␤Constraint type check failed for parameter '$foos'␤  in sub foo at /tmp/KCxnFKVH0X line 1␤  in block <unit> at /tmp/…»
23:43 ZoffixLappy Any idea what the 'must be a positive..' message is printed TWICE when using the subset as a sig in the sub?
23:44 djbkd joined #perl6
23:44 ZoffixLappy s/what/why/;
23:44 leont Managed to make Proc::Async call :done (and presumably :quit), but await on stdout still hands :-/
23:45 dogbert17 yeah, it takes quite some time to run with the size set to 1001, hopefully things will improve in the coming months
23:46 dogbert17 there is also a high chance that I'm using a lousy method in order to solve the problem
23:47 ZoffixLappy m: sub foo ($foos where { $_ > 2 or warn "fail" }) {};
23:47 camelia rakudo-moar 4b0e5b: ( no output )
23:47 ZoffixLappy m: sub foo ($foos where { $_ > 2 or warn "fail" }) {}; foo -2
23:47 camelia rakudo-moar 4b0e5b: OUTPUT«fail  in block  at /tmp/z3WXOD2Mgv line 1␤fail  in block  at /tmp/z3WXOD2Mgv line 1␤Constraint type check failed for parameter '$foos'␤  in sub foo at /tmp/z3WXOD2Mgv line 1␤  in block <unit> at /tmp/z3WXOD2Mgv line 1␤␤»
23:47 ZoffixLappy Seems like sub signature subsets are evaluated TWICE :S
23:50 dogbert17 timotimo: thanks for looking into this problem, timotimo++
23:58 leont Ow wait, that was supposed to hang, because that cast doesn't make sense to me.

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo