Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-05-09

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

All times shown according to UTC.

Time Nick Message
00:11 timotimo oh tadzik this is the imgur thing i wanted to show: http://imgur.com/R7T4Gzn
00:17 BenGoldberg joined #perl6-dev
00:39 Geth ¦ perl6-pod-to-bigpage: samcv++ created pull request #7: Set default directory as "."
00:39 Geth ¦ perl6-pod-to-bigpage: review: https://github.com/perl6/perl6-pod-to-bigpage/pull/7
01:07 Zoffix samcv: you have the commit bit for that repo.
01:07 samcv oh
01:07 samcv nice. ok
01:08 Geth ¦ perl6-pod-to-bigpage: c3109bccb7 | (Samantha McVey)++ | bin/pod2onepage
01:08 Geth ¦ perl6-pod-to-bigpage: Set default directory as "."
01:08 Geth ¦ perl6-pod-to-bigpage:
01:08 Geth ¦ perl6-pod-to-bigpage: Otherwise since it is not a required parameter, we fail part way
01:08 Geth ¦ perl6-pod-to-bigpage: through the bulid process:
01:08 Geth ¦ perl6-pod-to-bigpage:
01:08 Geth ¦ perl6-pod-to-bigpage: Cannot resolve caller dir(IO::Path: ); none of these signatures match:
01:08 Geth ¦ perl6-pod-to-bigpage:     (IO::Path:D $: Mu :$test = { ... }, :$absolute, :$Str, :$CWD = { ... }, *%_)
01:08 samcv success!
01:08 Geth ¦ perl6-pod-to-bigpage:   in block <unit> at
01:08 Geth ¦ perl6-pod-to-bigpage: review: https://github.com/perl6/perl6-pod-to-bigpage/commit/c3109bccb7
01:08 Geth ¦ perl6-pod-to-bigpage: a29f524cfd | (Samantha McVey)++ (committed using GitHub Web editor) | bin/pod2onepage
01:08 Geth ¦ perl6-pod-to-bigpage: Merge pull request #7 from samcv/master
01:08 Geth ¦ perl6-pod-to-bigpage:
01:08 Geth ¦ perl6-pod-to-bigpage: Set default directory as "."
01:08 Geth ¦ perl6-pod-to-bigpage: review: https://github.com/perl6/perl6-pod-to-bigpage/commit/a29f524cfd
03:32 MasterDuke_ m: my $i; try say $i % 2
03:32 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in code  at <tmp> line 1␤0␤»
03:32 MasterDuke_ m: my int $i; try say $i % 2
03:32 camelia rakudo-moar 20cfd6: OUTPUT: «0␤»
03:33 MasterDuke_ m: my Int $i; try say $i % 2
03:33 camelia rakudo-moar 20cfd6: ( no output )
03:33 MasterDuke_ RT #121154
03:33 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=121154
03:34 MasterDuke_ the ticket thinks the first result (warn then "0") is correct, everyone else agree?
03:43 geekosaur at one point that was correct. dunno if it's still considered so
03:44 geekosaur (I notice the ticket references both niecza and parrot...)
03:45 MasterDuke_ yeah, that's why i wasn't sure it was still expected
05:08 geekosaur joined #perl6-dev
06:55 astj_ joined #perl6-dev
07:51 AlexDaniel joined #perl6-dev
08:17 astj joined #perl6-dev
09:03 * dogbert11 notices test failures in t/04-nativecall/11-cpp.t and t/04-nativecall/15-rw-args.t
09:04 * dogbert11 does a complete rebuild
09:11 |Tux| joined #perl6-dev
09:54 geekosaur joined #perl6-dev
10:01 Zoffix .
10:01 yoleaux 08:23Z <samcv> Zoffix: docs still mention slurp-rest for Proc objects https://docs.perl6.org/type/Proc
10:02 Zoffix It's fine, for now I think. There are still users who won't have .slurp on Pipes and .slurp-rest will still exist for several years
10:14 samcv i mean it should mention .slurp too righ? atm it doesn't mention slurp period
10:14 samcv can use it fine though
10:19 astj joined #perl6-dev
10:31 astj joined #perl6-dev
11:49 |Tux| sorry, forgot to run timings. running now
12:01 |Tux| This is Rakudo version 2017.04.3-206-g20cfd6b7c built on MoarVM version 2017.04-57-g8d8a09b9
12:01 |Tux| csv-ip5xs        2.930
12:01 |Tux| test            12.522
12:01 |Tux| test-t           4.256 - 4.275
12:01 |Tux| csv-parser      12.785
12:06 Zoffix buggable: speed 10
12:06 buggable Zoffix, ▃▂▂▃▂▃▁▁▁▁ data for 2017-05-05–2017-05-09; range: 4.247s–4.376s; 3% faster
12:11 Zoffix MasterDuke_: this all really going back to the "Undef is 0" issue which is abjectly broken
12:12 dogbert11 it's blindingly fast
12:12 dogbert11 test-t that is :)
12:18 MasterDuke_ Zoffix: my understanding was that only undef native ints are 0
12:18 Zoffix MasterDuke_: here's my last adventure to fix it: https://irclog.perlgeek.de/perl6-dev/2016-12-19#i_13767071 that didn't got well. IMO it's one Perl 5 "feature" that should've been left to Perl 5. We have proper types and multiple numeric types so "undefs are zero" concept doesn't work at all, because you don't know at all times WHICH numeric should the undef be used as.
12:19 Zoffix MasterDuke_: that's a completely different issue; there's no undef native ints, so you get a zero automatically.
12:19 Zoffix In Perl 5 and in some areas in Perl 6, using an undefined value as a numeric makes it a zero + issues a warning
12:20 Zoffix m: say quietly +Num
12:20 camelia rakudo-moar 20cfd6: OUTPUT: «0␤»
12:20 Zoffix m: say +Num
12:20 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Num in numeric context␤  in block <unit> at <tmp> line 1␤0␤»
12:20 Zoffix m: say 42 + Any
12:20 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in block <unit> at <tmp> line 1␤42␤»
12:20 jnthn I think anywhere that does a .Numeric coercion, no?
12:21 Zoffix I see + was fixed since december, but I'm sure there are more cases where it's not handled right
12:21 jnthn Same for trying to stringify a type object, except that gives the empty string
12:21 jnthn m: say 42 - Any
12:21 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in block <unit> at <tmp> line 1␤42␤»
12:21 jnthn m: say 42 * Any
12:21 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in block <unit> at <tmp> line 1␤0␤»
12:21 jnthn m: say 42 / Any
12:21 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in block <unit> at <tmp> line 1␤Attempt to divide 42 by zero using div␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:22 jnthn Seems OK in all those at least
12:22 Zoffix jnthn: right. That's concept has the same issue.
12:22 Zoffix m: Str.contains: 42
12:22 camelia rakudo-moar 20cfd6: OUTPUT: «Cannot resolve caller contains(Str: Int); none of these signatures match:␤    (Str:D $: Cool:D $needle, *%_)␤    (Str:D $: Str:D $needle, *%_)␤    (Str:D $: Cool:D $needle, Cool:D $pos, *%_)␤    (Str:D $: Str:D $needle, Int:D $pos, *%_)␤  in bl…»
12:22 Zoffix Just as broken
12:23 Zoffix m: say cos 0
12:23 camelia rakudo-moar 20cfd6: OUTPUT: «1␤»
12:23 Zoffix m: say cos Num
12:23 camelia rakudo-moar 20cfd6: OUTPUT: «Cannot resolve caller cos(Num: ); none of these signatures match:␤    (Num:D $: *%_)␤  in block <unit> at <tmp> line 1␤␤»
12:24 jnthn Yeah, I'm not sure whether the synopses have somewhere a clear rule on where the "warning + 0" and "warning + ''" should apply/not.
12:24 Zoffix m: quietly say (+Rat).^name;
12:24 camelia rakudo-moar 20cfd6: OUTPUT: «Int␤»
12:26 nine Haha! I weiss jetzt, warum t/ovc_transfer.t auf jenkins und beta failed.
12:27 Zoffix Ya! Ya!
12:27 Zoffix Shprehen ze Dauch
12:28 MasterDuke_ maybe i'll give that RT a pass for now
12:29 nine oops :)
12:29 Zoffix m: say quietly Int + 1
12:29 camelia rakudo-moar 20cfd6: OUTPUT: «Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'.  Did you forget a '.new'?␤  in block <unit> at <tmp> line 1␤␤»
12:29 Zoffix m: say Any + 1
12:29 camelia rakudo-moar 20cfd6: OUTPUT: «Use of uninitialized value of type Any in numeric context␤  in block <unit> at <tmp> line 1␤1␤»
12:30 jnthn D'oh
12:30 Zoffix m: say Int / 1
12:30 camelia rakudo-moar 20cfd6: OUTPUT: «Parameter 'nu' of routine 'DIVIDE_NUMBERS' must be an object instance of type 'Int', not a type object of type 'Int'.  Did you forget a '.new'?␤  in block <unit> at <tmp> line 1␤␤»
12:30 jnthn Yeah, that lot really could use a cleanup
12:31 Zoffix MasterDuke_++ # liking the method names in error messages
12:32 [Coke] (docs, adding --> Foo) - should only be done where the source has this annotation, IMO.
12:32 Zoffix [Coke]: of which implementation?
12:33 Zoffix Or to rephrase: that requires having a preferred implementation and I thought the docs were meant to be neutral on that and the --> Foo merely indicates the type of return value per spec, not whether a particular implementation actually specified it as a return type constraint
12:34 Zoffix I guess there's nothing stopping roast from enforcing return type constraints, but is there a benefit to doing so?
12:36 Zoffix And having it in signatures in docs means I can just glance at the sig to know the type instead of raking through all the prose, trying to find it.
12:38 Zoffix And the signatures in docs aren't 100% accurate anyway. Some methods have special extra candidates for optimization reasons that don't change the range of accepted arguments.
12:57 MasterDuke_ Geth: ver https://github.com/rakudo/rakudo/commit/33ef5a95459b95bf7256391a053550d4efe221de
12:58 Geth MasterDuke_, version bump brought in these changes: https://github.com/perl6/nqp/compare/    # Load the specified byte buffer as if it was the contents of a...    # precompiled file
12:59 Zoffix It currently can only handle sole commit bumps. https://github.com/perl6/geth/issues/6
13:00 MasterDuke_ oh ha, that commit i tried is even the example in the issue
13:00 Zoffix To make the URL you can just use https://github.com/perl6/nqp/compare/$OLD_STRING_IN_VERSION_FILE...$NEW_STRING_IN_VERSION_FILE
13:04 MasterDuke_ Geth: ver https://github.com/perl6/nqp/compare/2016.04-14-gd54d719...2016.04-72-g77fa587
13:05 Zoffix heh, no I meant you'd visit that URL in github
13:05 Zoffix That's the URL the bot would've given you
13:05 robertle joined #perl6-dev
13:06 * MasterDuke_ needs a way to make coffee that doesn't create loud noises that wakes up babies
13:07 MasterDuke_ huh, don't see anything obvious there
13:07 * Zoffix shudders at the thought of having sleeping babies you fear waking up
13:07 Zoffix ZofBot: you're the only baby I need!
13:07 ZofBot Zoffix, tap( { say "Thank you for your attention"; exit 0 } ); would catch Control-C, thank you, and then exit
13:30 Zoffix heh, what a scam. ISO's site offers the PDF spec for CAD$270: https://www.iso.org/standard/51502.html
13:31 Zoffix So, hey, you gotta do what you gotta do, eh? But Adobe actually offers that spec for free from: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
13:31 Zoffix :)
13:32 nine Zoffix: usually one can also find release candidates of spec documents for free online
13:34 Zoffix sheesh. 756 pages
13:34 Zoffix ZofBot: ain't no body got time for that!
13:34 ZofBot Zoffix, 'ωωω' that will take any given sequence and use it as the universe of incrementation for any matching characters in the string
13:34 jnthn "universe of incrementation"? :D
13:34 Zoffix :)
13:41 * [Coke] is glad he doesn't usually have to worry about PDF guts these days
13:41 * [Coke] remembers having to generate PDFs by hand uphill both ways
13:41 jnthn w/in 31
13:41 jnthn d'oh :)
13:43 buggable joined #perl6-dev
13:48 * [Coke] thinks that should be manually entered into the drawing. ;)
13:50 * jnthn is still getting used to the keyboard at his new office :)
13:52 * Zoffix always buys keyboards in pairs: one for home and same another one for office
13:53 Zoffix buggable: draw
13:53 buggable Zoffix, The next Accidental /win Lottery draw will happen in 4 weeks, 2 days, 10 hours, 6 minutes, and 7 seconds. Currently have 5 ballots submitted by 5 users!
13:54 Zoffix Geth: uptime
13:54 Geth Zoffix, 2 days, 19 hours, 26 minutes, and 39 seconds
13:54 Zoffix NeuralAnomaly: status
13:54 NeuralAnomaly Zoffix, [✘] Next release will be in 1 week and 4 days. Since last release, there are 23 new still-open tickets (10 unreviewed and 0 blockers) and 231 unreviewed commits. See http://perl6.fail/release/stats for details
13:54 Zoffix 1 week :o
14:05 Zoffix buggable: author zoffixznet
14:05 buggable Zoffix, Found 38 dists for zoffixznet. See https://temp.perl6.party/buggable/9531812847546921494338741.html
14:06 Zoffix I had a gist somewhere with `[]` on Str doing substr. I can make it a module, I guess.
14:08 Zoffix And then make a module that makes Str + Str do concatenation :P
14:14 jnthn buggable: author jnthn
14:14 buggable jnthn, Found 18 dists for jnthn. See https://temp.perl6.party/buggable/3336986249337091494339251.html
14:14 jnthn Waaay behind Zoffix++ :)
14:17 Geth ¦ rakudo/nom: 6bb1b5b409 | (Zoffix Znet)++ | src/core/Instant.pm
14:17 Geth ¦ rakudo/nom: Remove argument forwarding from Instant.DateTime coercer
14:17 Geth ¦ rakudo/nom:
14:17 Geth ¦ rakudo/nom: - Our coercers generally don't take any args
14:17 Geth ¦ rakudo/nom: - Just forwarding args leaks implementation detail by coupling the
14:17 Geth ¦ rakudo/nom:     args taken to DateTime.new
14:17 Geth ¦ rakudo/nom: - The :timezone arg can simply be replaced with .in-timezone method
14:17 Geth ¦ rakudo/nom:     call anyway.
14:17 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6bb1b5b409
14:18 [Coke] buggable: author coke
14:19 buggable [Coke], Found 2 dists for coke. See https://temp.perl6.party/buggable/03427737174405311494339542.html
14:19 [Coke] oh, I have something else I could probably distify.
14:30 Zoffix m: say (-64+0i)**(1/3)
14:30 camelia rakudo-moar 20cfd6: OUTPUT: «2+3.46410161513775i␤»
14:30 Zoffix That's really wrong :/
14:31 Zoffix m: say (-64+0i)**(333333333333333e-15)
14:31 camelia rakudo-moar 6bb1b5: OUTPUT: «2+3.46410161513775i␤»
14:33 MasterDuke_ wolframalpha seems to agree
14:33 MasterDuke_ https://www.wolframalpha.com/input/?i=(-64%2B0i)**(1%2F3)
14:33 * dogbert11 notes that Zoffix has managed to find a SEGV
14:34 Zoffix That's because wolframalpha is also wrong
14:35 Zoffix But the wrongness is due to limited precision in 0.33333333333333
14:36 Zoffix I think
14:36 Zoffix Yeah
14:37 Zoffix (-64) ** (1/3) in Google gives right answer, but swapping 1/3 to 0.333333333333 gives the same bogus 2+blahi result
14:37 Zoffix But I guess that answers why we always give NaN instead of computing real results for odd roots when possible :)
14:38 Zoffix (when `i` is not used)
14:39 Zoffix m: say 2+3.46410161513775i ≅ -4
14:39 camelia rakudo-moar 6bb1b5: OUTPUT: «False␤»
14:41 * Zoffix doesn't know about complex numbers enough to know why slight imprecision in a power results in wildly different real and imaginary parts :/
14:42 Zoffix m: (2+3.46410161513775i).abs.say
14:42 camelia rakudo-moar 6bb1b5: OUTPUT: «4␤»
14:42 Zoffix Ahhh
14:42 Zoffix cool
14:43 moritz internally, power calculations happen in the (angle, magnitude) zylinder coordinates
14:43 moritz so it's cartesian -> zylinder, then the actual calculation, and then back
14:44 moritz and calculating a power in zylinder coordinates is applying the power to the magnitude, and mupltiply the angle by the powser
14:44 Zoffix Sounds like ≅ could use more love for complex numbers
14:45 moritz m: say (2+3.46410161513775i).polar[1]
14:45 camelia rakudo-moar 6bb1b5: OUTPUT: «1.0471975511966␤»
14:45 moritz m: say (2+3.46410161513775i).polar[1] / pi * 180
14:45 camelia rakudo-moar 6bb1b5: OUTPUT: «60␤»
14:45 Zoffix m: say (-4+0i).polar[1] / pi * 180
14:45 camelia rakudo-moar 6bb1b5: OUTPUT: «180␤»
14:46 moritz a complex number has multiple roots, with equally spaced angles (and the same magnitude)
14:47 moritz and ** just picks one of them
14:47 moritz not necessarily the one closest to the real axis (0 or 180 degrees) which we'd find intuitive
14:47 moritz which is fine, for a math point of view
14:50 Zoffix m: sub infix:<≅>(\a,\b) { a.polar[0] ≅ b.polar[0] and (my $n = ([max] (a, b)».polar[1]) / [min] (a, b)».polar[1])) ≅ $n.floor  } say 2+3.46410161513775i ≅ -4+0i
14:50 camelia rakudo-moar 6bb1b5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3 b)».polar[1]) / [min] (a, b)».polar[1])7⏏5) ≅ $n.floor  } say 2+3.46410161513775i ␤    expecting any of:␤        statement end␤        statement modif…»
14:50 Zoffix m: sub infix:<≅>(\a,\b) { a.polar[0] ≅ b.polar[0] and (my $n = ([max] (a, b)».polar[1]) / [min] (a, b)».polar[1]) ≅ $n.floor  } say 2+3.46410161513775i ≅ -4+0i
14:50 camelia rakudo-moar 6bb1b5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3 / [min] (a, b)».polar[1]) ≅ $n.floor  }7⏏5 say 2+3.46410161513775i ≅ -4+0i␤    expecting any of:␤        infix…»
14:51 Zoffix m: sub infix:<≅>(\a,\b) { a.polar[0] ≅ b.polar[0] and (my $n = ([max] (a, b)».polar[1]) / [min] (a, b)».polar[1]) ≅ $n.floor }; say 2+3.46410161513775i ≅ -4+0i
14:51 camelia rakudo-moar 6bb1b5: OUTPUT: «No such method 'polar' for invocant of type 'Num'␤  in sub infix:<≅> at <tmp> line 1␤  in sub infix:<≅> at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:51 Zoffix bah
14:52 Zoffix Ah, doh. I still need core ops :)
14:53 Zoffix m: sub infix:<≅>(\a,\b) { a.polar[0] =~= b.polar[0] and (my $n = ([max] (a, b)».polar[1]) / [min] (a, b)».polar[1]) =~= $n.floor }; say 2+3.46410161513775i ≅ -4+0i
14:53 camelia rakudo-moar 6bb1b5: OUTPUT: «False␤»
14:53 Zoffix boo
14:54 dogbert11 Zoffix: here's what gdb has to say about your SEGV in RT #131264
14:54 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131264
14:54 moritz you can't cover that case with a smarter comparison op
14:54 dogbert11 https://gist.github.com/dogbert17/9537aa399a180e5f859ac41ad0d2d5be
14:54 Zoffix moritz: why can't?
14:55 moritz because depending on the operation you're looking at, that angle difference might or might not be very relevant
14:55 Zoffix hm
14:56 * Zoffix is a bit annoyed with 131264
14:56 moritz and then depending on the operation, some integer-multiples might be OK, and others might not
14:56 Zoffix The problem is with OpenSSl but I have like 2 or 3 people sending me messages about it, for me to just be the messenger and keep all correspondence together :/
14:56 moritz which is why, in general, you'd look at $complex_number.roots($n) instead of just using **
14:57 Zoffix moritz: the operation is ≅
14:57 Zoffix m: say <2+3.46410161513775i>.roots
14:57 camelia rakudo-moar 6bb1b5: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
14:58 Zoffix dogbert11: here's a reply from original author of the ticket: https://gist.github.com/zoffixznet/012a8356230b3b82802211330eaa1275
14:58 Zoffix Which for some reason didn't get onto the ticket, presumably because the author doesn't have an account on RT
15:00 jnthn I'm pretty sure IO::Socket::SSL isn't thread-safe, or at least from the reading I did when implement IO::Socket::Async::SSL it sure looked that way
15:00 Zoffix Ahh
15:00 * [Coke] notes that .roots on an Int makes it go through complex, so you can't do "(-64).roots(3)" either.
15:01 Zoffix m: (-64).roots(3)
15:01 camelia rakudo-moar 6bb1b5: ( no output )
15:01 Zoffix m: say (-64).roots(3)
15:01 camelia rakudo-moar 6bb1b5: OUTPUT: «(2+3.46410161513775i -4+4.89858719658941e-16i 2-3.46410161513775i)␤»
15:01 [Coke] m: say 64.roots(3); say (-64).roots(3);
15:01 camelia rakudo-moar 6bb1b5: OUTPUT: «(4+0i -2+3.46410161513775i -2-3.46410161513775i)␤(2+3.46410161513775i -4+4.89858719658941e-16i 2-3.46410161513775i)␤»
15:01 [Coke] interesting that the positive one is exact but the negative one isn't.
15:01 Zoffix Ah yeah, here are the two numbers. The -4 and the 2+blah
15:01 moritz yes, .roots is an inheritly complex operation
15:01 moritz [Coke]: working with an angle of 0 is generally easier on the error bars
15:02 moritz whereas not being a computer algebra system, an angle of pi generally has a numerical error
15:13 Zoffix dogbert11: I rejected 131264. It does look to be due to OpenSSL not being thread safe and there's even an Issue on it for it: https://github.com/sergot/openssl/issues/31
15:15 dogbert11 Zoffix: cool
15:38 Zoffix m: use MONKEY; augment class Str { method AT-POS {} }
15:38 camelia rakudo-moar 6bb1b5: ( no output )
15:38 Zoffix erm
15:38 Zoffix Ah, nevermind. Misread my error
15:39 Zoffix $ perl6 -Ilib -MPythonic::Str -e 'my $i; $i++ for "foobar"; say $i'
15:39 Zoffix 6
15:39 Zoffix :) that's rather perverrted :)
15:43 Zoffix Seems to interfere with loading of modules tho... lol. Just hangs
16:06 * Zoffix gives up with `AT-POS` approach and goes for postcircumfix:<[ ]>
16:06 Zoffix Doesn't look like we have a method to do ranged AT-POS; e.g. method AT-POS (Range $x) {} or whatever; basically something that gets called whenever more than 1 index is asked for
16:07 Zoffix Oh, and making Str Positional seems to explode .split due to now-ambiguous candidates :)
16:08 timotimo right, AT-POS is really just about a single position
16:09 Zoffix I see
16:09 timotimo postcircumfix:<[ ]> is what handles ranges and lists and multidimensional slices and all that jazz
16:09 timotimo (though there is an AT-POS-MULTIDIM, but that's only for a single position)
16:10 Zoffix Which really sucks, I think
16:10 Zoffix s/Which//
16:10 Zoffix m: &postcircumfix:<[ ]>.candidates.elems.say
16:10 camelia rakudo-moar 6bb1b5: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant value [ ] in sink context (lines 1, 1)␤65␤»
16:11 Zoffix .o( useless?? )
16:11 Zoffix But yeah, basically to make my own proper iterable, I have to define 65 multies and then pray Rakudo doesn't add more
16:12 Zoffix maybe a bit fewer, since named args don't have to be replicated and can be merely forwarded
16:13 Zoffix Because sub postcircumfix:<[ ]> (Str:D, |c) {} isn't specific enough to go before all the other candidates :/
16:14 Zoffix Unless... I shadow ALL the core candidates with two multies: one that handles Str and other that just forwards to core :P
16:15 Zoffix m: dd &CORE::postcircumfix:<[ ]>([42, 72], 1)
16:15 camelia rakudo-moar 6bb1b5: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant value [ ] in sink context (lines 1, 1)␤Int <element> = 72␤»
16:15 Zoffix mc: dd &CORE::postcircumfix:<[ ]>([42, 72], 1)
16:15 committable6 Zoffix, ¦2015.12: «Int <element> = 72»
16:16 Zoffix bisect: dd &CORE::postcircumfix:<[ ]>([42, 72], 1)
16:16 bisectable6 Zoffix, Bisecting by output (old=2015.12 new=6bb1b5b) because on both starting points the exit code is 0
16:16 bisectable6 Zoffix, bisect log: https://gist.github.com/ed50b929382d5f8e80e97a8116451fdb
16:16 bisectable6 Zoffix, (2017-03-07) https://github.com/rakudo/rakudo/commit/127338a9dc3d35c570eecbb70ab6446772ba4bf2
16:18 TimToady Perl 6 goes to great lengths to prevent accidental genericity in syntax, but there's only so much it can do to prevent accidental genericity in semantics...
16:18 Zoffix .tell TimToady this commit made `m: say postcircumfix:<[ ]>(1)` issue a useless `useless use` warning for the colonpair. Any idea how to fix that? https://github.com/rakudo/rakudo/commit/127338a9dc3d35c570eecbb70ab6446772ba4bf2
16:18 yoleaux Zoffix: I'll pass your message to TimToady.
16:18 Zoffix Oh
16:19 TimToady you end up running into the problem described in The Search for the Perfect Language, by Umberto Eco
16:19 yoleaux 16:18Z <Zoffix> TimToady: this commit made `m: say postcircumfix:<[ ]>(1)` issue a useless `useless use` warning for the colonpair. Any idea how to fix that? https://github.com/rakudo/rakudo/commit/127338a9dc3d35c570eecbb70ab6446772ba4bf2
16:21 TimToady well, typically I turn on RAKUDO_OPTIMIZER_DEBUG to find out where the code that marked it as sunk is (or failed to mark it as wanted)
16:22 TimToady but usually you can just inspect that action code for the construct and see where there is a missing wanted()
16:23 Zoffix huggable: ping
16:23 * Zoffix must be lagging... no response from any bots...
16:23 huggable Zoffix, nothing found
16:24 Zoffix joined #perl6-dev
16:24 Zoffix huggable: ping
16:24 huggable Zoffix, nothing found
16:24 Zoffix yey
16:24 Zoffix TimToady: ok, then I'll try to fix it
16:25 TimToady it's kind of odd that extending void context to comma arguments would cause that in a construct that has no commas, but the compiler uses implicit infix:<,> in lots of places, so I guess it's not that surprising
16:25 TimToady the hardest part of adding a wanted is remembering to put the second argument, which is a tag to identify where it was marked wanted :)
16:25 Zoffix doesn't seem to be a way to silence it from user-land either
16:25 Zoffix m: $ = postcircumfix:<[ ]>(1)
16:25 camelia rakudo-moar 6bb1b5: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant value [ ] in sink context (lines 1, 1)␤»
16:25 Zoffix m: quietly { $ = postcircumfix:<[ ]>(1) }
16:25 camelia rakudo-moar 6bb1b5: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant value [ ] in sink context (lines 1, 1)␤»
16:26 TimToady quietly is runtime
16:28 TimToady also, I'd note that postcircumfix should take two arguments
16:34 Zoffix Ah, there is:
16:34 Zoffix m: say CORE::{q|&postcircumfix:<[ ]>|}(<a b>, 1)
16:34 camelia rakudo-moar 6bb1b5: OUTPUT: «b␤»
16:38 Zoffix m: multi foo (Str:D, |c) {say "here"}; multi foo (|c) { say "there" }; foo "foo"
16:38 camelia rakudo-moar 6bb1b5: OUTPUT: «Ambiguous call to 'foo'; these signatures all match:␤:(Str:D $, |c is raw)␤:(|c is raw)␤  in block <unit> at <tmp> line 1␤␤»
16:39 Zoffix One day I'll figure out the specificity rules... One day!
16:40 Zoffix But, my approach with two multies for postcircumfix:<[ ]> worked:
16:40 Zoffix $ perl6 -Ilib -MPythonic::Str -e 'say "foobar"[3..6]; '
16:40 Zoffix bar
16:40 Zoffix :)
16:43 TimToady you got away with it this time, but eventually you get to the point where you really need different types to support different semantics :)
16:43 Zoffix :)
16:53 ggoebel joined #perl6-dev
17:20 Zoffix m: multi foo (Int $x) {}; multi foo (|c) {}; foo 42, :meow
17:20 camelia rakudo-moar 6bb1b5: OUTPUT: «Unexpected named argument 'meow' passed␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:20 Zoffix :(
17:21 Zoffix One day! :)
17:21 Zoffix (I'll learn the rules)
17:21 Zoffix Like named don't participate in dispatch or whatever
17:24 jnthn Only as tie-breakers
17:24 jnthn That one just comes down to the arity rules
17:24 Zoffix m: multi foo (Int $x) { say "oooh" }; multi foo (Int $x, *%_) { say "here" }; multi foo (|c) {say "there"}; foo 42, :meow
17:24 camelia rakudo-moar 6bb1b5: OUTPUT: «Ambiguous call to 'foo'; these signatures all match:␤:(Int $x)␤:(Int $x, *%_)␤  in block <unit> at <tmp> line 1␤␤»
17:25 Zoffix But not slurpies?
17:25 Zoffix m: multi foo (Int $x, *%_) {nextsame if %_; say "here";}; multi foo (|c) {say "there";}; foo 42; foo 42, :meow
17:25 camelia rakudo-moar 6bb1b5: OUTPUT: «here␤there␤»
17:25 Zoffix I ended up with that ^
17:26 jnthn m: m: multi foo (Int $x) { say "oooh" }; multi foo (Int $x, *%_) { say "here" }; foo 42, :meow
17:26 camelia rakudo-moar 6bb1b5: OUTPUT: «Ambiguous call to 'foo'; these signatures all match:␤:(Int $x)␤:(Int $x, *%_)␤  in block <unit> at <tmp> line 1␤␤»
17:26 jnthn m: m: multi foo (Int $x) { say "oooh" }; multi foo (Int $x, :$meow, *%_) { say "here" }; foo 42, :meow
17:26 camelia rakudo-moar 6bb1b5: OUTPUT: «here␤»
17:26 jnthn Hmm
17:26 jnthn That one surprises me a bit
17:26 jnthn Ohh
17:26 jnthn But :/
17:27 jnthn Methods all have a *%_
17:27 jnthn So that'd mean that *every method* could become tie-broken
17:28 jnthn Which would be a near promise of bustage.
17:28 Zoffix Yeah
17:28 * jnthn wanders off to see if eating dinner will be an easier problem :)
17:33 Zoffix m: <a b c>[0]:delete
17:33 camelia rakudo-moar 6bb1b5: OUTPUT: «Can not remove elements from a List␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
17:33 Zoffix m: <a b c>[*]:delete
17:33 camelia rakudo-moar 6bb1b5: ( no output )
17:33 Zoffix (the latter is a list of Failures)
17:35 Zoffix huh
17:35 Zoffix m: dd <a b c>[*][0]
17:35 camelia rakudo-moar 6bb1b5: OUTPUT: «"a"␤»
17:35 Zoffix m: dd <a b c>[*]:exists[0]
17:35 camelia rakudo-moar 6bb1b5: OUTPUT: «(Bool::True, Bool::True, Bool::True)␤»
17:35 Zoffix I'd expect the second one to give 1 True, not a whole list
17:35 Zoffix m: dd (<a b c>[*]:exists)[0]
17:35 camelia rakudo-moar 6bb1b5: OUTPUT: «Bool::True␤»
17:35 Zoffix Like this
17:36 Zoffix Ah
17:36 Zoffix Precedence. The [0] is on the :exists
17:36 Zoffix m: dd <a b c>[*](:exists[0])
17:36 camelia rakudo-moar 6bb1b5: OUTPUT: «Invocant of method 'CALL-ME' must be a type object of type 'List', not an object instance of type 'List'.  Did you forget a 'multi'?␤  in block <unit> at <tmp> line 1␤␤»
17:36 Zoffix well something or other
17:36 Zoffix or maybe not
17:36 Zoffix m: dd <a b c>[*]:exists[100000]
17:36 camelia rakudo-moar 6bb1b5: OUTPUT: «(Bool::True, Bool::True, Bool::True)␤»
17:42 Zoffix Filed it as https://rt.perl.org/Ticket/Display.html?id=131279
17:46 timotimo jnthn: liz has already multiple times wished for something to write into the signature that'd mean "and no further named arguments"
17:46 Zoffix m: dd 'foobar'.comb.[^*-3].grep(*.defined).join
17:46 camelia rakudo-moar 6bb1b5: OUTPUT: «"foo"␤»
17:47 * Zoffix wonders if that's a feature or a bug...
17:47 Zoffix that == the above construct returning a list of stuff and Failures, so that you can grep out the Failures and get a usable result...
17:48 Zoffix http://starecat.com/content/wp-content/uploads/bug-feature-by-design.jpg
17:52 Zoffix shiet... another bug
17:52 Zoffix m: dd ("a".."z")[(3, (4, (5,)))]
17:52 camelia rakudo-moar 6bb1b5: OUTPUT: «("d", ("e", ("f",)))␤»
17:52 Zoffix m: dd ("a".."z")[(3, (4, (5,)))]:p
17:52 camelia rakudo-moar 6bb1b5: OUTPUT: «(3 => "d",)␤»
17:52 Zoffix m: dd ("a".."z")[(3, (4, (5,)))]:k
17:52 camelia rakudo-moar 6bb1b5: OUTPUT: «(3,)␤»
17:52 Zoffix m: dd ("a".."z")[(3, (4, (5,)))]:kv
17:52 camelia rakudo-moar 6bb1b5: OUTPUT: «(3, "d")␤»
17:52 Zoffix Who know writing a silly module would be so useful :)
17:52 Zoffix *knew
17:52 Zoffix If only the log site were working so I could easily copy-paste this stuff off IRC logs when filing :/
17:53 Zoffix And it started working as soon as I wrote that, of course!
17:56 Zoffix Affects hashes too
17:56 ggoebel joined #perl6-dev
17:58 timotimo good catch
17:59 Zoffix Filed as https://rt.perl.org/Ticket/Display.html?id=131280
18:40 sasheto joined #perl6-dev
19:14 AlexDaniel joined #perl6-dev
19:22 Ven joined #perl6-dev
19:27 Ven_ joined #perl6-dev
19:35 robertle joined #perl6-dev
19:36 Ven_ joined #perl6-dev
20:14 Ven_ joined #perl6-dev
20:36 Ven joined #perl6-dev
20:54 dct joined #perl6-dev
21:02 Ven_ joined #perl6-dev
21:20 Ven joined #perl6-dev
21:29 Zoffix m: ^5 .grep.say
21:29 camelia rakudo-moar 6bb1b5: OUTPUT: «Cannot resolve caller grep(Range: ); none of these signatures match:␤    ($: Bool:D $t, *%_)␤    ($: Mu $t, *%_)␤  in block <unit> at <tmp> line 1␤␤»
21:30 Zoffix too bad that don't work :)
21:30 Zoffix m: ^5 .grep({$_}).say # would've figured it'd do this
21:30 camelia rakudo-moar 6bb1b5: OUTPUT: «(1 2 3 4)␤»
21:33 lizmat m: (1,2,3).grep # there's just no .grep() candidate at all, afaik
21:33 camelia rakudo-moar 6bb1b5: OUTPUT: «Cannot resolve caller grep(List: ); none of these signatures match:␤    ($: Bool:D $t, *%_)␤    ($: Mu $t, *%_)␤  in block <unit> at <tmp> line 1␤␤»
21:35 jnthn What would such a candidate do?
21:36 lizmat Zoffix assumed nqp::istrue($_)
21:38 Zoffix Yeah
21:38 Zoffix grep on truthiness by default
21:38 jnthn My other guess was "don't filter anything out"
21:38 jnthn Given .grep(?*) is all it takes to be explicit, it's probably not worth leaving people guessing
21:39 Zoffix What's the point of not filtering anything out? :)
21:39 Zoffix I've just used *.so
21:39 jnthn That's what I wondered when I read it :P
21:39 Zoffix heh
21:40 jnthn Then realized the truthy interpretation
22:24 Geth ¦ rakudo/nom: 2df7060cad | (Elizabeth Mattijsen)++ | 3 files
22:24 Geth ¦ rakudo/nom: Make BagHash.grab() an additional 30% faster
22:24 Geth ¦ rakudo/nom:
22:24 Geth ¦ rakudo/nom: - it was already profiting from .roll improvements
22:24 Geth ¦ rakudo/nom: - now uses the R:Q.BAG-ROLL logic
22:24 Geth ¦ rakudo/nom: - only needs one time .WHICH calculation now
22:24 Geth ¦ rakudo/nom: - tested on a 1-element BagHash where the element exhausted at the end
22:24 Geth ¦ rakudo/nom: - other situation will probably see a better improvement
22:24 Geth ¦ rakudo/nom: - an extra 20% to be had when we decontainerize BagHashes
22:24 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2df7060cad
22:47 BenGoldberg joined #perl6-dev

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