Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-03-07

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 SmokeMachine m: my $x = 3; my @a = $x xx 3; my $b = $x xx 3; $x = 5; say @a; say $b
00:00 camelia rakudo-moar 2a2e46: OUTPUT: «[3 3 3]␤(5 5 5)␤»
00:00 thundergnat IOninja: Yep, that's what I ended up with.
00:00 Cabanossi joined #perl6
00:00 IOninja m: say ($y xx 10).^name
00:00 camelia rakudo-moar 2a2e46: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$y' is not declared␤at <tmp>:1␤------> 3say (7⏏5$y xx 10).^name␤»
00:00 IOninja m: say ('x' xx 10).^name
00:00 camelia rakudo-moar 2a2e46: OUTPUT: «List␤»
00:00 naxieAlDle ahhh… this is what bothers me
00:00 IOninja c: 2015.10 say ('x' xx 10).^name
00:00 committable6 IOninja, ¦2015.10: «List»
00:00 naxieAlDle c: d192f1c29a^,d192f1c29a my $y = <y>; my @y; @y[0] = $y xx 10; say @y; @y[0][4] = <o>; say @y;
00:00 committable6 naxieAlDle, ¦d192f1c29a^: «[(y y y y y y y y y y)]␤Cannot assign to a readonly variable or a value␤  in block <unit> at /tmp/U4RgS3eglu:1␤ «exit code = 1»» ¦d192f1c: «[(y y y y y y y y y y)]␤[(o o o o o o o o o o)]»
00:00 naxieAlDle https://github.com/rakudo/rakudo/commit/​d192f1c29a6297b2607e512e65022fbe4ad5771c
00:01 naxieAlDle “Make xx quite a bit faster”
00:01 thundergnat But It surprised me at first and I needed to ponder what was going on
00:01 IOninja naxieAlDle: what bothers you? That you got faster xx?
00:01 naxieAlDle IOninja: that we got this behavior unintentionally
00:02 IOninja That's not the part you quoted.
00:02 IOninja A developer can't think of all the edge cases something may affect. We have tests for that job and in this case they didn't catch the issue.
00:03 naxieAlDle I'm just pointing out that this was unintentional
00:03 IOninja Saying "'Make xx quite a bit faster'....this bothers me" will just make that developer contribute elsewhere I think...
00:03 naxieAlDle that's not what I meant, sorry
00:03 IOninja m: my $x = 42; my $a = $x, $x, $x; say $a; $x = 72; say $a
00:03 camelia rakudo-moar 2a2e46: OUTPUT: «42␤42␤»
00:04 IOninja m: my $x = 42; my $a = ($x, $x, $x); say $a; $x = 72; say $a
00:04 camelia rakudo-moar 2a2e46: OUTPUT: «(42 42 42)␤(72 72 72)␤»
00:04 IOninja star: my $x = 42; my $a = ($x, $x, $x); say $a; $x = 72; say $a
00:04 camelia star-m 2016.10: OUTPUT: «(42 42 42)␤(72 72 72)␤»
00:04 naxieAlDle c: d192f1c29a^,d192f1c29a my $y = 25; say ($y xx 10).WHAT
00:04 committable6 naxieAlDle, ¦d192f1c29a^: «(Seq)» ¦d192f1c: «(List)»
00:04 naxieAlDle ah-ha
00:04 naxieAlDle but still…
00:05 IOninja The Seq probably still had that problem, hidden behind reification
00:05 k-man joined #perl6
00:05 IOninja c: d192f1c29a^,d192f1c29a my $y = 25; my @a = ($y xx 10).cache; say @a; say @a
00:05 committable6 IOninja, ¦d192f1c29a^,d192f1c: «[25 25 25 25 25 25 25 25 25 25]␤[25 25 25 25 25 25 25 25 25 25]»
00:07 IOninja risou: your incessant nick-change away feature is kinda spammy. It's common courtesy not to have that enabled.
00:09 thundergnat The only reason I brought it up is that there were some changes to make xx thunk the left hand side at one point to make things like rand xx 4 work like most people expect.
00:10 thundergnat I rashly thought that it would "thunk" containers too... To the extent that I thought at all.
00:10 IOninja Yeah, that's been that way for a while.
00:10 IOninja m: sub x { $ = rand }; my @a = x() xx 2; say @a; say @a
00:10 camelia rakudo-moar 2a2e46: OUTPUT: «[0.185815223569128 0.452429042720225]␤[0.185815223569128 0.452429042720225]␤»
00:11 IOninja m: sub x { $/ = rand }; my @a = x() xx 2; say @a; say @a
00:11 camelia rakudo-moar 2a2e46: OUTPUT: «[0.514069592865973 0.394482647460151]␤[0.514069592865973 0.394482647460151]␤»
00:11 IOninja m: my @a = ($/ = rand) xx 2; say @a; say @a
00:11 camelia rakudo-moar 2a2e46: OUTPUT: «[0.124562822271418 0.124562822271418]␤[0.124562822271418 0.124562822271418]␤»
00:11 thundergnat Anyway, not a big deal. Mostly just mumbling about my own misunderstanding.
00:12 IOninja thundergnat: it *is* pretty surprising.
00:13 thundergnat Something else I was wondering. I there any way in Perl 6 to open STDIN non blocking?
00:13 thundergnat *Is
00:14 IOninja ATM only a hackish way
00:14 thundergnat Is that something that is just NYI? Or something that should be in module space?
00:15 IOninja Something like keep retrying to use it (e.g. if you're using prompt()) until it stops throwing, so it ends up using the thread that opened it
00:15 IOninja thundergnat: NYI. It's something to do with with libuv being paranoid about who's reading stuff.
00:15 thundergnat Ah.
00:17 IOninja m: my @a = ($,) xx 10; @a[0][0] = 42; say @a
00:17 camelia rakudo-moar 2a2e46: OUTPUT: «[(42) (42) (42) (42) (42) (42) (42) (42) (42) (42)]␤»
00:17 IOninja heh
00:18 thundergnat I've used Term::termios to do immediate reads of key-presses (no need to hit enter) but it still blocks if there isn't a character ready and I couldn't find any obvious way to O_NONBLOCK $*IN.
00:18 IOninja Oh, THAT's what you mean./..
00:19 IOninja I thought you meant via threads.
00:19 BenGoldberg joined #perl6
00:19 IOninja like, do `start prompt "blah"`; cause that fails ATM
00:20 IOninja Well... the obvious way to do what you want is to read via a channel and poll the channel, but that uses threads, so you're hit with the issue I originally mentioned :(
00:23 IOninja thundergnat: tried .readchars?
00:23 IOninja The docs say "up to.." so maybe it doesn't block...
00:23 IOninja .readchars(1)
00:23 IOninja m: $*IN.slurp.chars.say
00:23 camelia rakudo-moar 2a2e46: OUTPUT: «No such method 'slurp' for invocant of type 'IO::Handle'␤  in block <unit> at <tmp> line 1␤␤»
00:24 thundergnat Hmm. I don't remember trying that.
00:24 IOninja m: $*IN.readchars(1000000000000000000000000000); say "hi"
00:24 camelia rakudo-moar 2a2e46: OUTPUT: «Cannot unbox 90 bit wide bigint into native integer␤  in block <unit> at <tmp> line 1␤␤»
00:24 IOninja m: $*IN.readchars(100000000000000000); say "hi"
00:24 camelia rakudo-moar 2a2e46: OUTPUT: «hi␤»
00:24 IOninja Seems to do the trick in the bot...
00:25 thundergnat That looks like it might work.
00:25 thundergnat \o/
00:25 IOninja \o/
00:28 IOninja c: d192f1c29a^,d192f1c29a my $y = 25; my @a; @a[0] = $y xx 10; say @a; $y = '♥'; say @a; say @a
00:28 committable6 IOninja, ¦d192f1c29a^: «[(25 25 25 25 25 25 25 25 25 25)]␤[(25 25 25 25 25 25 25 25 25 25)]␤[(25 25 25 25 25 25 25 25 25 25)]» ¦d192f1c: «[(25 25 25 25 25 25 25 25 25 25)]␤[(♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥)]␤[(♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥)]»
00:30 Cabanossi joined #perl6
00:34 IOninja thundergnat: filed your container thing: https://rt.perl.org/Ticket/Disp​lay.html?id=130941#txn-1452835
00:34 IOninja IMO there's no DWIM in that case... just a WAT
00:37 naxieAlDle IOninja++
00:40 thundergnat I vaguely remember Timtoady doing some special casing during the GLR where assigning a list to an array would decontainerize since that is what most people would expect.
00:41 thundergnat The problem is that for multi dim arrays, there is no way to be able to tell if the nth level wants to be an item or array, so you need to explicitly assign it.
00:41 thundergnat (as an array if you want it to be one.)
00:44 IOninja m: my $y = 25; my @a[1;10]; @a = $y xx 10,; say @a; $y = '♥'; say @a
00:44 camelia rakudo-moar 2a2e46: OUTPUT: «[[25 25 25 25 25 25 25 25 25 25]]␤[[25 25 25 25 25 25 25 25 25 25]]␤»
00:46 IOninja probably can be fixed with a new nqp::decont()
00:47 * IOninja is too tired to do it right now...
00:51 ZzZombo_ joined #perl6
00:51 ZzZombo_ joined #perl6
00:58 khw joined #perl6
01:09 ZzZombo joined #perl6
01:09 ZzZombo joined #perl6
01:14 cibs joined #perl6
01:15 skids joined #perl6
01:19 zakharyas joined #perl6
01:26 k-man joined #perl6
01:34 riatre joined #perl6
01:39 killbill joined #perl6
01:45 ZzZombo joined #perl6
01:46 ZzZombo joined #perl6
01:52 raschipi joined #perl6
01:57 itaipu joined #perl6
01:58 samcv I have my grant about ready to submit. if somebody could read through and proofread it for me that would be great https://gist.github.com/samcv/1​21351d79e4b46a56e7c3efa3a7980b3
02:00 Cabanossi joined #perl6
02:00 naxieAlDle .oO( ≈½ instead of ~1/2 :) )
02:08 travis-ci joined #perl6
02:08 travis-ci Doc build errored. Tom Browder 'declare $string so xt test passes'
02:08 travis-ci https://travis-ci.org/perl6/doc/builds/208405299 https://github.com/perl6/doc/com​pare/2321be87f6d0...4c0eb45b6c1b
02:08 travis-ci left #perl6
02:11 samcv eww github's pod renderer renders it as At the current time ~½
02:11 samcv tfw perl 5 unicode
02:12 setty1 joined #perl6
02:12 mcmillhj joined #perl6
02:12 samcv just gonna use the word `half` instead
02:14 naxieAlDle haha
02:24 astj Hi. with recent rakudo's change, requiring different modules under same namespace like `require Foo; require Foo::Bar;` seems broken?
02:24 astj It say "Lexical 'Foo' already declared". https://github.com/astj/p6-Require-Bug-Demo
02:29 labster joined #perl6
02:33 itaipu joined #perl6
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:53 raschipi joined #perl6
03:00 xtreak joined #perl6
03:02 ZzZombo_ joined #perl6
03:12 cdg joined #perl6
03:14 noganex joined #perl6
03:16 dataf3l joined #perl6
03:21 dataf3l joined #perl6
03:30 Cabanossi joined #perl6
03:36 cdg_ joined #perl6
03:39 agentzh joined #perl6
03:39 mcmillhj joined #perl6
03:39 cdg joined #perl6
03:40 cdg joined #perl6
03:45 mcmillhj joined #perl6
03:51 cdg joined #perl6
03:59 mcmillhj joined #perl6
04:04 wamba joined #perl6
04:11 mcmillhj joined #perl6
04:21 kanishka joined #perl6
04:24 mcmillhj joined #perl6
04:30 Cabanossi joined #perl6
04:36 xtreak joined #perl6
04:58 Cabanossi joined #perl6
05:01 mcmillhj joined #perl6
05:22 mcmillhj joined #perl6
05:26 pullphinger joined #perl6
05:44 cibs joined #perl6
05:44 mcmillhj joined #perl6
05:55 mcmillhj joined #perl6
05:57 Cabanossi joined #perl6
05:59 CIAvash joined #perl6
06:27 xtreak joined #perl6
06:28 mtj_ joined #perl6
06:30 mtj_ joined #perl6
06:42 Cabanossi joined #perl6
06:50 RabidGravy joined #perl6
06:56 bjz joined #perl6
07:03 jonas1 joined #perl6
07:06 domidumont joined #perl6
07:07 rindolf joined #perl6
07:09 samcv kk submitted the proposal \o/
07:10 [ptc] joined #perl6
07:11 domidumont joined #perl6
07:11 wamba joined #perl6
07:22 RabidGravy Boom!
07:29 alphah joined #perl6
07:36 cibs joined #perl6
07:40 El_Che lizmat: Do you have the paper book of "Perl: The Complete Reference. Second Edition", Osborne, 2001? If not (not likely), I found one here at work.
07:43 El_Che lizmat: this is the cover: http://claudio.ulyssis.be/​var/tmp/cover_ptcr2nd.pdf
07:56 dct joined #perl6
07:57 mcmillhj joined #perl6
07:59 darthdeus_ joined #perl6
08:15 bjz joined #perl6
08:18 xinming_ joined #perl6
08:19 mcmillhj joined #perl6
08:19 samcv SourceBaby, help
08:19 SourceBaby samcv, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/d​ist/CoreHackers::Sourcery
08:20 samcv Scalar
08:20 samcv SourceBaby, Scalar
08:20 nadim joined #perl6
08:20 lizmat El_Che: looks familiar...  but not easy to check for me at the moment, as the library is currently residing in our other house  :-)
08:25 mcmillhj joined #perl6
08:32 dakkar joined #perl6
08:43 Cabanossi joined #perl6
08:54 mcmillhj joined #perl6
08:54 parv joined #perl6
08:55 El_Che lizmat: there is no urgency what so ever. I'll set it aside. I have seen that on your shelf, but it may have been the 1ste edition. Hence the question.
08:55 lizmat oki, thanks for thinking about it  :-)
08:55 darutoko joined #perl6
08:56 samcv s: Scalar
08:56 SourceBaby samcv, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Scalar); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
08:59 * lizmat clickbaits https://p6weekly.wordpress.com/2017/03/06/2017-10-≤-its-all-relative-≥/
09:01 samcv lizmat, how do you feel about nested if else's https://github.com/rakudo/rakudo/blob/​nom/src/Perl6/Actions.nqp#L7441-L7450
09:02 samcv personally they are super distracting to me, would it be okay to change them all to be standard convention? or no
09:02 lizmat they're not my favourite, but I can live with them :-)
09:02 lizmat *if* you change them, make sure it is only cosmetics that you change and note that in the commit message
09:03 samcv kk
09:03 lizmat jnthn prefers fewer lines of code over more lines of code, so he can see better what is going on
09:04 smls joined #perl6
09:04 samcv does he like nested?
09:06 lizmat he likes fewer lines of code
09:06 samcv i dislike them because it distracts me when I'm scanning a file visually, eyes linger on that line which doesn't have that much content. kk
09:07 lizmat I dislike them when I'm editing and moving blocks of code around
09:08 lizmat but other than that I don't care too much
09:08 lizmat El_Che: woolfy just confirms to me that we have the book already
09:10 smls Is is possible for a unit-test script to replace an imported function as seen by the module it's testing?
09:10 smls My situation is like this:
09:10 smls 1) Module A exports a subroutine which connects to the Internet and returns something.
09:10 smls 2) Module B `use`s module A, and calls this function.
09:10 smls 3) When unit-testing module B, I'd like it to use a mock version of this function, that doesn't connect to the Internet (and instead is controlled by the test file).
09:13 lizmat smls: maybe wrap the sub exported by A, and not calling the original code ?
09:14 smls How can the test file control what it returns?
09:18 lizmat m: module A { our sub foo() is export { "foo" } }; import A; &A::foo.wrap(-> { "bar" }); say A::foo; say foo   # seems that wrapping doesn't change the imported
09:18 camelia rakudo-moar 5b7b7f: OUTPUT: «bar␤foo␤»
09:19 lizmat m: module A { our sub foo() is export { "foo" } }; import A; BEGIN &A::foo.wrap(-> { "bar" }); say A::foo; say foo
09:19 camelia rakudo-moar 5b7b7f: OUTPUT: «bar␤bar␤»
09:19 lizmat ah, needs to be wrapped at compile time
09:20 lizmat smls: that could work, no ?
09:21 smls The .wrap would have to happen inside module B though, right?
09:21 smls How can the test file control what it is wrapped with?
09:21 lizmat smls: don't think so: the wrap in my code didn't happen in the scope of A either
09:22 lizmat you need to have the subroutine be "our" though
09:22 smls lizmat: It happened in the scope that `use` A, which would be module B in my scenario
09:23 Xliff_ joined #perl6
09:30 itaipu joined #perl6
09:31 smls m: module A { our sub foo() is export { "foo" } };  module B { import A; our sub call-foo() { foo } };  use Test; import B; &B::foo.wrap(-> { "bar" }); is B::call-foo, "bar";
09:31 camelia rakudo-moar 5b7b7f: OUTPUT: «No such method 'wrap' for invocant of type 'Any'␤  in block <unit> at <tmp> line 1␤␤»
09:31 pullphinger joined #perl6
09:32 smls ^^ this is more like the situation at hand
09:32 lizmat m: module A { our sub foo() is export { "foo" } };  module B { import A; our sub call-foo() { foo } };  use Test; import B; BEGIN &B::foo.wrap(-> { "bar" }); is B::call-foo, "bar";
09:32 camelia rakudo-moar 5b7b7f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤An exception occurred while evaluating a BEGIN␤at <tmp>:1␤Exception details:␤  No such method 'wrap' for invocant of type 'Any'␤    in code  at <tmp> line 1␤␤»
09:33 smls B::call-foo is what I want to unit test
09:33 lizmat smls: must be afk for a few hours, will check when back
09:33 smls ok
09:36 xtreak joined #perl6
09:46 smls In Perl 5, symbol table mangling (or Sub::Override or Test::MockModule) should do the trick.
09:46 smls But in Perl 6, lexical scopes can't be modified once compiled (correct me if I'm wrong), so that approach doesn't work...
09:59 nadim joined #perl6
10:02 mcmillhj joined #perl6
10:09 mcmillhj joined #perl6
10:14 cibs joined #perl6
10:21 mcmillhj joined #perl6
10:29 smls let's take this to SO: http://stackoverflow.com/questions/​42645801/how-to-mock-an-imported-su​broutine-when-unit-testing-a-module
10:36 andrzejku joined #perl6
10:38 itaipu joined #perl6
10:39 samcv smls, let me know if you find the answer
10:41 El_Che smls: is inhereting from that class and overwritting the method and option? That's something I often do
10:42 El_Che s/overwriting/overriding/g
10:43 Cabanossi joined #perl6
10:45 smls El_Che: There are no classes here, only modules that export subroutines.
10:45 smls But yeah, refactoring it to be more "OO" would be a last-resort solution, though it seems LTA that this should be neseccary in order to make unit tests possible.
10:46 jnthn I'd probably provide a way for the module to be configured with an alternative
10:46 jnthn Even if that's just an optional export of a set-internet-fetching-thingy(&foo)
10:46 El_Che smls: I see.
10:47 jnthn Or just make it an optional argument to the subroutine under test, and have it pick the one from the module as the default
10:47 El_Che smls: I guess "everything is a package" in perl5 is a nice thing :)
10:47 jnthn That way the code becomes more extensible as well as more testable
10:47 El_Che jnthn: test code in the regular sub? Not very nice
10:47 jnthn I'm sure there's ways to do clever stuff with CompUnit repos, by sticking something at the head of the chain that will intercept and mess with imported symbols
10:47 jnthn El_Che: That ain't what I said
10:48 * El_Che rereads
10:49 jnthn use BlahWithBar; sub do-some-thing($foo) { ... bar() ... }
10:49 jnthn Could instead me
10:49 jnthn *be
10:49 jnthn use BlahWithBar; sub do-some-thing($foo, :&bar-strategy = &bar) { ... bar-strategy() ... }
10:49 jnthn With appropriate naming
10:50 jnthn That way not only do you get a way to test it, but you get a way for people so supply an alternative implementation to the default chosen, if they should need to
10:50 ZzZombo joined #perl6
10:50 ZzZombo joined #perl6
10:51 smls jnthn: Hm, that's actually not a bad idea in the case I'm working on.
10:52 smls Still, sometimes that's not something one wants.
10:53 jnthn Sometimes, in which case I suspect some clever module that lets you fake up imports at a distance would be needed
10:53 smls Is there a module wishlist somewhere, so I can add "Test::MockImport based on CompUnit magic" ? :P
10:53 jnthn I think so
10:53 jnthn perl6-most-wanted or whatever it's called
10:53 jnthn If you were doing OO stuff I'd point at Test::Mock :)
10:54 jnthn I think import mocking wants to be a separate module, though
10:56 smls jnthn: What the &bar weren't imported but defined in the same module as &do-some-thing, would there be any way to override that when loading the module from the test script?
10:57 smls *What if
10:59 smls I.e. disable pre-compilation, and do something to the module while it is compiled & loaded by the use statement.
11:02 jnthn smls: Possibly; I'm not immediately sure how I'd arrange that, though an evil way would be to slurp in the source and append a CHECK block before compiling it that does .wrap on the sub in question, and never defers to the original but instead calls the thing we want to test
11:02 jnthn Uh, thing we want to mock it with, I meant
11:04 smls That doesn't sound much more evil than the Perl 5 solutions (glob assignment etc.)... :)
11:08 xtreak joined #perl6
11:09 bjz_ joined #perl6
11:14 araraloren joined #perl6
11:17 IOninja Is Bart Weigmans here?
11:19 mscha joined #perl6
11:19 mscha m: say eⁱ
11:19 camelia rakudo-moar 5b7b7f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    eⁱ used at line 1␤␤»
11:19 mscha m: say e**i
11:19 camelia rakudo-moar 5b7b7f: OUTPUT: «0.54030230586814+0.841470984807897i␤»
11:20 IOninja ⁱ is not a power operator
11:20 mscha I know.  :-)
11:21 mscha Too bad there's not a superscript π in Unicode.  I want an all-Unicode version of ...
11:21 mscha m: e**(π×i) + 1 ≅ 0
11:21 camelia rakudo-moar 5b7b7f: ( no output )
11:21 mscha m: say e**(π×i) + 1 ≅ 0
11:21 camelia rakudo-moar 5b7b7f: OUTPUT: «True␤»
11:22 araraloren write a module for it
11:24 mscha m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say eⁱ;
11:24 camelia rakudo-moar 5b7b7f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    eⁱ used at line 1␤␤»
11:24 mscha m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say 2.71828182845905ⁱ;
11:24 camelia rakudo-moar 5b7b7f: OUTPUT: «0.540302305868138+0.841470984807898i␤»
11:24 IOninja ha-ha
11:25 jnthn IOninja: He's brrt and on #moarvm
11:27 Geth ¦ perl6-most-wanted: d6062de102 | smls++ | most-wanted/modules.md
11:27 Geth ¦ perl6-most-wanted: Add module ideas to help with mocking non-OO code in unit tests
11:27 Geth ¦ perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/d6062de102
11:29 Geth ¦ doc: d5bff8fabe | (Zoffix Znet)++ | README.md
11:29 Geth ¦ doc: Trigger rebuild
11:29 Geth ¦ doc:
11:29 Geth ¦ doc: To see if there are Pod parsing issues with latest Rakudo
11:29 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d5bff8fabe
11:32 mscha m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say (e)ⁱ;
11:32 camelia rakudo-moar 5b7b7f: OUTPUT: «0.54030230586814+0.841470984807897i␤»
11:33 mscha m: say ³⁄₄₇;
11:33 camelia rakudo-moar 5b7b7f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3say ³7⏏5⁄₄₇;␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤    …»
11:36 aborazmeh joined #perl6
11:36 aborazmeh joined #perl6
11:40 tbrowder mscha: ref unicode super- and subscripts, do you know if there is a  set of font data ( as in Font::AFM) for the unicode font you use (font matrics is the term for that data)?
11:40 mcmillhj joined #perl6
11:43 mscha tbrowder: no, sorry, I don't know much about fonts, just using the default browser font.
11:43 wamba joined #perl6
11:44 Actualeyes joined #perl6
11:45 tbrowder never mind, i'm thinking of printed matter, not on-line browser stuff
11:46 tbrowder although the bright folks here could create the css and wrapper stuff to present the sub- and superscripts
11:49 IOninja That already comes with browsers in the form of <sup> and <sub> elements
11:51 lukaramu joined #perl6
11:58 mcmillhj joined #perl6
12:00 Actualeyes joined #perl6
12:02 bjz joined #perl6
12:05 raschipi joined #perl6
12:08 mcmillhj joined #perl6
12:13 Cabanossi joined #perl6
12:20 mcmillhj joined #perl6
12:22 GK___1wm____SU joined #perl6
12:22 GK___1wm____SU left #perl6
12:24 travis-ci joined #perl6
12:24 travis-ci Doc build passed. Zoffix Znet 'Trigger rebuild
12:24 travis-ci https://travis-ci.org/perl6/doc/builds/208553583 https://github.com/perl6/doc/com​pare/4c0eb45b6c1b...d5bff8fabe70
12:24 travis-ci left #perl6
12:25 lep_ joined #perl6
12:26 ZzZombo joined #perl6
12:26 ZzZombo joined #perl6
12:43 Cabanossi joined #perl6
12:44 sena_kun joined #perl6
12:45 mcmillhj joined #perl6
12:53 wamba joined #perl6
12:57 mr-foobar joined #perl6
13:00 Sound joined #perl6
13:01 mcmillhj joined #perl6
13:19 [Coke] (yay, doc xtest clean)
13:26 rindolf joined #perl6
13:26 cdg joined #perl6
13:28 cdg joined #perl6
13:33 lukaramu_ joined #perl6
13:35 [Coke] IOninja: (d5bff8fabe) there is a file -specifically- in the repo for those shenanigans
13:37 IOninja Which one is it?
13:37 [Coke] util/trigger-rebuild.txt
13:37 kurahaupo__ joined #perl6
13:37 [Coke] because samcv was adding trailing whitespace to things and causing 'make xtest' to fail.
13:38 IOninja Well, I didn't add any whitespace
13:38 IOninja Don't know why there's a special file for this at all TBH
13:38 Geth ¦ doc: 272259097d | (Will "Coke" Coleda)++ | doc/Type/Str.pod6
13:38 Geth ¦ doc: remove trailing whitespace
13:38 Geth ¦ doc: review: https://github.com/perl6/doc/commit/272259097d
13:38 [Coke] because we shouldn't be making irrelevant changes to trigger rebuilds.
13:39 [Coke] making random changes for that sort of thing gums up blame, history, sometimes tests...
13:40 Chinese_soup joined #perl6
13:40 [Coke] for her, we depend on a specific version of a 3rd party lib; we should actual depend on it and declare the dependency, and have that trigger the rebuild; yours could have been a dep on a specific version of rakudo
13:41 [Coke] she created the file as a compromise, so at least all the commits of that type would be in one place.
13:42 Cabanossi joined #perl6
13:45 [Coke] (I realize this lies more towards "theoretically" than "practically")
13:50 bjz joined #perl6
13:50 mcmillhj joined #perl6
14:08 mr-foobar joined #perl6
14:16 yqt joined #perl6
14:23 lizmat joined #perl6
14:23 cdg_ joined #perl6
14:39 smls joined #perl6
14:39 smls m: my %hash = a => {b => 42};  dd %hash{"a"}{"b"};
14:39 camelia rakudo-moar 76a59c: OUTPUT: «Int % = 42␤»
14:39 smls m: my %hash = a => {b => 42};  dd %hash{"a";"b"};
14:39 camelia rakudo-moar 76a59c: OUTPUT: «(42,)␤»
14:40 smls ^^ Why does a multi-dimensional Hash index return a List, even if a single leaf node was selected?
14:41 smls m: my @array = 0, [0, 42];  dd @array[1;1]
14:41 camelia rakudo-moar 76a59c: OUTPUT: «Int <element> = 42␤»
14:41 smls ^^ In case of Arrays, this doesn't happen.
14:42 lizmat smls: feels rakudobuggable
14:42 smls will do
14:53 naxieAlDle joined #perl6
14:54 ZzZombo joined #perl6
14:54 ZzZombo joined #perl6
14:56 skids joined #perl6
14:58 [Coke] which way is the bug? (slices should always return lists, no?)
14:59 [Coke] m: my @array = 0, [0, 42];  dd @array[1;1][0];
14:59 camelia rakudo-moar 76a59c: OUTPUT: «42␤»
14:59 [Coke] Or, I suppose, it doesn't matter, because you can treat an element like a list.
15:00 naxieAlDle mscha: you can mention your unicode ideas here: https://gist.github.com/Alex​Daniel/c89bd2786f9b63f31e4c
15:01 naxieAlDle but that's just a list of all ideas, not a list of something we actually want to add to Perl 6…
15:03 IOninja Not always. @parameters and @.attributes will reject it
15:04 IOninja m: sub (@){}( (@)[1;1] )
15:04 camelia rakudo-moar 76a59c: OUTPUT: «Type check failed in binding to '<anon>'; expected Positional but got Any (Any)␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:05 IOninja m: class { has @.x }.new: x => (@)[1;1]
15:05 camelia rakudo-moar 76a59c: ( no output )
15:05 IOninja Just params I guess
15:06 IOninja m: class { has @.x; method foo { dd @.x } }.new(x => (@)[1;1]).foo
15:06 camelia rakudo-moar 76a59c: OUTPUT: «Array @!x = [Any]␤»
15:06 IOninja m: class { has @.x; submethod BUILD (:@!x) {} }.new: x => (@)[1;1]
15:06 camelia rakudo-moar 76a59c: OUTPUT: «Type check failed in binding to '@!x'; expected Positional but got Any (Any)␤  in submethod BUILD at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:08 poska joined #perl6
15:08 poska hey guys
15:09 poska how do you use variables inside rule definitions in a grammar?
15:10 poska e.g. rule foo { \d+ {$!my-special-variable} }
15:10 poska this doesn't seem to work
15:10 smls [Coke]: .[1; 2] is not a slice, it indexes a singular element. No reasoin to expect .{"a"; "b"}  to be different.
15:11 smls [Coke]: .[1, 2] would be a slice, as would .[1; 2,] - i.e. when the subscript for at least one dimension is an Iterable.
15:13 IOninja poska: what are you trying to accomplish?
15:13 Cabanossi joined #perl6
15:13 IOninja private attributes won't work, since ever rule is a separate instance of Cursor or something like that
15:13 poska i have a rule which must repeat a fixed amount of times
15:14 poska and with each parse call, this amount differs
15:14 IOninja OK
15:14 IOninja Well, you can use dynamic variables to pass that information
15:14 poska could you share a working snippet of this?
15:15 IOninja m: my $*FOO = 3; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij'
15:15 camelia rakudo-moar 76a59c: OUTPUT: «「abcdefghij」␤ foo => 「abc」␤»
15:15 IOninja m: my $*FOO = 10; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij'
15:15 camelia rakudo-moar 76a59c: OUTPUT: «Nil␤»
15:15 IOninja m: my $*FOO = 10; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghijddassdadas'
15:15 camelia rakudo-moar 76a59c: OUTPUT: «「abcdefghijddassdadas」␤ foo => 「abcdefghij」␤»
15:16 poska nice! thank you
15:16 IOninja m: say grammar { token TOP { $<n>=\d+ {my $*FOO = +$<n>} <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg'
15:16 camelia rakudo-moar 76a59c: OUTPUT: «Dynamic variable $*FOO not found␤  in regex bar at <tmp> line 1␤  in regex TOP at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in regex bar at <tmp> line 1␤  in regex TOP at <tmp> line 1␤  in block <unit> at <tmp>…»
15:16 IOninja m: say grammar { token TOP { $<n>=\d+ :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg'
15:16 camelia rakudo-moar 76a59c: OUTPUT: «Use of Nil in numeric context␤  in regex TOP at <tmp> line 1␤「3abcdefg」␤ n => 「3」␤ bar => 「」␤»
15:16 IOninja m: say grammar { token TOP { $<n>=\d+ {} :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg'
15:16 camelia rakudo-moar 76a59c: OUTPUT: «「3abcdefg」␤ n => 「3」␤ bar => 「abc」␤»
15:16 IOninja m: say grammar { token TOP { $<n>=\d+ {} :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '5abcdefg'
15:16 camelia rakudo-moar 76a59c: OUTPUT: «「5abcdefg」␤ n => 「5」␤ bar => 「abcde」␤»
15:17 IOninja It's also available in Actions
15:17 naxieAlDle m: my $x = ‘hello’; say ‘hello’ ~~ /<{$x}>/
15:17 camelia rakudo-moar 76a59c: OUTPUT: «「hello」␤»
15:17 IOninja (and the empty block {} is there to update the $/ variable so that $<n> capture would be in it)
15:17 smls poska: You could maybe also pass it down as a parameter:   rule n-times ($n) { . ** {$n} };
15:18 smls Call it like  <n-times(5)>
15:18 poska i didn't know you can pass parameters to rules
15:18 naxieAlDle there are some limitations to this, if I recall correctly
15:18 naxieAlDle namely you cannot have parameterized protos or something
15:19 poska are dynamic variables accessed globally?
15:19 IOninja poska: they're accessed in dynamic scope
15:20 poska is it possible to pass a parameter to the grammar on construction and then expose it as a dynamic variable?
15:21 moritz yes, you could override the parse method in the grammar to set the dynamic variable when parsing beings
15:21 moritz *begins
15:21 IOninja you can use dynamic variables in token parameters: e.g.  token foo ($*FOO) {... } and then it'll be available
15:22 poska okay, still need to wrap this in my head :D i'm quite new to p6
15:22 IOninja You can use :$args name param, can't you? No need to override anything
15:22 IOninja m: say grammar { token TOP ($*FOO) { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij', :args[3]
15:22 camelia rakudo-moar 76a59c: OUTPUT: «「abcdefghij」␤ foo => 「abc」␤»
15:22 IOninja yup
15:31 smls m: grammar A { token TOP ($n) { <foo($n)> .* };  token foo ($n) { . ** {$n} } };  say A.parse("Hello world", args => \(4))
15:31 camelia rakudo-moar e2db7b: OUTPUT: «「Hello world」␤ foo => 「Hell」␤»
15:31 smls poska: This ^^ is what I meant, with passing it down as a parameter.
15:32 poska can you explain what does args => \(4) do?
15:32 smls 'args' is a named argument accepted by the .parse method
15:33 smls it takes a Capture of arguments to pass to rule TOP
15:33 [Coke] m: say (\(4)).perl
15:33 camelia rakudo-moar e2db7b: OUTPUT: «\(4)␤»
15:33 smls \( )  constructs a Capture, which is a collection of positional and/or named arguments that can be passed to a function or method
15:34 poska so it's sort of a function signature?
15:34 smls it's something that can be *passed* to a signature
15:35 smls a.k.a. an "argument list"
15:37 poska ok, this integrates perfectly! thanks
15:37 poska in the python world i imagine this as foo(*(1, 2, 3)), when the function naturally accepts foo(1, 2, 3)
15:38 perlpilot joined #perl6
15:40 IOninja There's no need to make it a capture
15:40 smls poska: In Perl6, | takes the role of Python's * in that case
15:40 smls m: sub a ($x, $y, :$foo) { say $x; say $y; say $foo };  my $args = \(1, 2, foo => 42);  a |$args
15:40 camelia rakudo-moar e2db7b: OUTPUT: «1␤2␤42␤»
15:41 IOninja m: grammar A { token TOP ($n) { <foo($n)> .* };  token foo ($n) { . ** {$n} } };  say A.parse("Hello world", :args[4])
15:41 camelia rakudo-moar e2db7b: OUTPUT: «「Hello world」␤ foo => 「Hell」␤»
15:41 IOninja m: 4.Capture
15:41 camelia rakudo-moar e2db7b: ( no output )
15:41 IOninja m: |4.Capture
15:41 camelia rakudo-moar e2db7b: ( no output )
15:41 IOninja Wonder why it complains about :4args ...
15:41 IOninja m: dd 4.Capture
15:41 camelia rakudo-moar e2db7b: OUTPUT: «\()␤»
15:41 IOninja m: dd |4.Capture
15:41 camelia rakudo-moar e2db7b: OUTPUT: «block <unit>␤»
15:41 IOninja m: dd [|4.Capture]
15:41 camelia rakudo-moar e2db7b: OUTPUT: «[]␤»
15:41 IOninja That's why :(
15:42 itaipu joined #perl6
15:44 cdg joined #perl6
15:46 IOninja Well, never mind. Seems .Capture is kinda busted, so makes sense to pass Capture to :args
15:48 khw joined #perl6
15:49 IOninja Oh, wait, it's the slipping of a capture that's busted...
15:49 IOninja m: dd [ [:42x].Capture ]
15:49 camelia rakudo-moar e2db7b: OUTPUT: «[\(:x(42))]␤»
15:49 IOninja m: dd [ |[:42x].Capture ]
15:49 camelia rakudo-moar e2db7b: OUTPUT: «[]␤»
15:50 IOninja m: grammar A { token TOP (:$n) { <foo($n)> .* };  token foo ($n) { . ** {$n} } };  say A.parse("Hello world", args => \(:42n) )
15:50 camelia rakudo-moar e2db7b: OUTPUT: «Nil␤»
15:50 IOninja m: grammar A { token TOP (:$n) { <foo($n)> .* };  token foo ($n) { . ** {$n} } };  say A.parse("Hello world", args => \(:2n) )
15:50 camelia rakudo-moar e2db7b: OUTPUT: «「Hello world」␤ foo => 「He」␤»
15:50 * IOninja moves this to #perl6-dev
15:53 movl joined #perl6
15:56 IOninja nevermind, .Capture isn't busted :)
15:56 moritz it's just creative! :-)
15:56 IOninja :)
15:58 ZzZombo joined #perl6
15:58 smls dd 4.List;  dd 4.Capture;
15:58 smls IOninja: Is that ^^ also correct?
15:59 smls m: dd 4.List;  dd 4.Capture;
15:59 Guest58048 joined #perl6
15:59 camelia rakudo-moar e2db7b: OUTPUT: «(4,)␤\()␤»
15:59 IOninja smls: no, but there's a ticket for that.
15:59 smls ok
15:59 IOninja Well, not IMO
16:00 IOninja It calls a Mu candidate that rakes for attributes and perhaps value types should provide their own Capture
16:00 IOninja m: dd class { has $.x = 42 }.new.Capture;
16:00 camelia rakudo-moar e2db7b: OUTPUT: «\(:x(42))␤»
16:04 IOninja Mu.Capture doesn't really makes sense to me.
16:04 IOninja m: dd now.Capture
16:04 camelia rakudo-moar e2db7b: OUTPUT: «\(:tai(<2936116123547/1972>))␤»
16:04 IOninja I'd just do it as { self.list.Capture }
16:04 timotimo turns any object into a capture by exposing its attributes
16:05 timotimo it's for doing stuff like for @pairs -> (:$key, :$value) { }
16:05 IOninja That stuff uses .Capture?
16:05 timotimo i thought so?
16:05 IOninja m: dd :42a.Capture
16:05 camelia rakudo-moar e2db7b: OUTPUT: «\(:key("a"), :value(42))␤»
16:06 araraloren I make a binding for a library ftplib, which name should be good ? Net::Ftplib or Net::ftplib or other ?
16:06 IOninja Net::FTPlib
16:06 IOninja FTPlib
16:06 araraloren IOninja, Hm, thanks.
16:07 timotimo you can call it "Al"
16:07 sufrostico joined #perl6
16:07 IOninja m: for :42a -> (:$key, :$value, :$uc) { dd [$key, $value, $uc]}
16:07 camelia rakudo-moar e2db7b: OUTPUT: «["a", 42, Mu]␤»
16:08 timotimo yeah, the "call method" semantics for pairs is just when you smartmatch
16:08 IOninja m: use MONKEY; augment class Pair { has $.uc = 'foo' }; for :42a -> (:$key, :$value, :$uc) { dd [$key, $value, $uc]}
16:08 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:09 IOninja augmentation failurage?
16:09 timotimo interesting
16:09 timotimo does Pair have a custom .Capture? i'd assume it does
16:09 timotimo but actually ... huh?
16:09 timotimo that's not what that'd be
16:09 timotimo s: Pair, "Capture", \()
16:09 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/​blob/76a59cf/src/core/Mu.pm#L680
16:10 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; .say for Pair.new.^attributes.flat
16:10 camelia rakudo-moar e2db7b: OUTPUT: «Mu $!key␤Mu $!value␤Mu $!uc␤»
16:10 IOninja m: for (4,) -> ($z) { dd [$z]}
16:10 camelia rakudo-moar e2db7b: OUTPUT: «Too few positionals passed; expected 1 argument but got 0 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
16:10 IOninja So I guess if 4.Capture gives \(4), the above will start to work...
16:11 smls I've always considered the  -> (:$key, :$value)  feature somewhat of a hack, and hope it'll me made unnecessary by a future   -> ($key => $value)   syntax... :)
16:11 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new."$_"() for Pair.new.^attributes.flat
16:11 camelia rakudo-moar e2db7b: OUTPUT: «No such method '$!key' for invocant of type 'Pair'␤  in block <unit> at <tmp> line 1␤␤»
16:11 [Coke] smls: what if you have more than 2?
16:11 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new.key
16:11 camelia rakudo-moar e2db7b: ( no output )
16:11 timotimo what the hay?
16:11 smls [Coke]: I meant specifically for destructuring keys.
16:11 [Coke] smls: ok
16:11 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new."key"()
16:11 camelia rakudo-moar e2db7b: ( no output )
16:12 timotimo oh, i had to substr the name, sure
16:12 smls [Coke]: Have you actually used the syntax for any other methods than .key. and .value?
16:12 IOninja I have
16:12 [Coke] timotimo: also you're not printing anything?
16:12 [Coke] smls: doubtful
16:12 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."$_.substr(2)"() for Pair.new.^attributes.flat
16:12 camelia rakudo-moar e2db7b: OUTPUT: «No such method 'substr' for invocant of type 'Attribute'␤  in block <unit> at <tmp> line 1␤␤»
16:12 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."$_.name.substr(2)"() for Pair.new.^attributes.flat
16:12 camelia rakudo-moar e2db7b: OUTPUT: «(Mu)␤(Mu)␤P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:12 IOninja smls: https://github.com/perl6/routine-​map/blob/master/bin/viewer.p6#L11
16:12 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."uc"() for Pair.new.^attributes.flat
16:12 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:12 timotimo m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new.uc() for Pair.new.^attributes.flat
16:12 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:13 timotimo so how come that explodes that way?
16:13 Cabanossi joined #perl6
16:13 timotimo m: use MONKEY; class Test { has $.a = "one", has $.b = "two" }; augment class Test { has $.uc = "foo" }; Test.new.uc()
16:13 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Test when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
16:13 smls IOninja: Is PATH_INFO a method, or a Hash entry in that case?
16:14 IOninja smls: hash key
16:14 SmokeMachine m: multi trait_mod:<is>(Variable $v, :$injected) {say $v.willdo}; my $a is injected # ← what's this willdo?
16:14 camelia rakudo-moar e2db7b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Too few positionals passed; expected 2 or 3 arguments but got 1␤at <tmp>:1␤»
16:15 IOninja m: class Pair { has $.uc = "foo" }; say Pair.new.uc
16:15 camelia rakudo-moar e2db7b: OUTPUT: «foo␤»
16:15 IOninja m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new.uc
16:15 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at <tmp> line 1␤␤»
16:15 IOninja m: use MONKEY; augment class Pair { has $.uc = "foo" }; 'say Pair.new.uc'.EVAL
16:15 smls IOninja: Then it would work with the suggested alternae syntax too:   -> % (PATH_INFO => $_, *%)
16:15 camelia rakudo-moar e2db7b: OUTPUT: «P6opaque: no such attribute '$!uc' in type Pair when trying to get a value␤  in block <unit> at EVAL_0 line 1␤  in block <unit> at <tmp> line 1␤␤»
16:16 SmokeMachine ok, its for trait_mod:<will>
16:16 IOninja smls: that would make it inconsistent with the rest of the language.
16:16 moritz SmokeMachine: some voodoo used for installing phasers
16:16 IOninja If :PATH_INFO($_) stops working in that particular instance.
16:17 * IOninja &
16:17 smls IOninja: It's mostly the fact that it translates into a method call in same cases, that I find weird.
16:17 IOninja smls: it doesn't tho
16:17 IOninja smls: as timotimo++ showed above, it uses the .Capture method on the given object and passes the capture to the subcapture.
16:17 smls The how does  -> (:key($foo))  work when passing a Pair?
16:17 smls oh
16:17 IOninja Pair.Capture rakes the key/value attributes
16:17 IOninja m: dd :42a.Capture
16:17 camelia rakudo-moar e2db7b: OUTPUT: «\(:key("a"), :value(42))␤»
16:18 IOninja and ^ that gets passed
16:19 mscha naxieAlDle: thanks, I'll have a look, and if I have any that aren't yet mentioned - it looks pretty complete at first glance - I'll add them, if they're not too ridiculous.  (I won't bother with eⁱ for instance.  :-)
16:20 smls IOninja: Still weird tho :P
16:24 smls IOninja, timotimo: Any idea why Mu.Capture doesn't simply do   method Capture { \( |self ) }  ?
16:24 smls Would be much less surprising IMO.
16:25 timotimo huh?
16:25 smls 4  -->  \(4)
16:25 timotimo why would it do that, though?
16:25 smls :4a  -->  \(:4a)
16:25 smls (1, 2)  -->  \(1, 2)
16:25 cibs joined #perl6
16:25 timotimo m: dd $*KERNEL.Capture
16:25 camelia rakudo-moar e2db7b: OUTPUT: «\(:auth("unknown"), :desc(Str), :name("linux"), :release("#1 SMP Fri Dec 9 16:18:38 UTC 2016 (3ec5648)"), :signature(Blob), :version(v4.4.36.8.default))␤»
16:25 smls (a => 2)  -->  \(:a(2))
16:25 grondilu joined #perl6
16:27 jnthn Because otherwise it'd be useless for destructuring objects
16:27 IOninja m: dd bag(<a b c c>).Capture
16:27 camelia rakudo-moar e2db7b: OUTPUT: «\()␤»
16:27 jnthn The deafult in Mu is fine, though it's apparent that various built-in types could have a more useful .Capture method
16:28 IOninja jnthn: would you agree that .Capture method can be added to some core types, e.g. on Int and Bag .Capture produces an empty list
16:28 IOninja OK.
16:28 jnthn But be careful about Pair, because there's likely code out there that destructures it into a key and a value
16:28 jnthn Yeah, .Capture on Bag producing an empty capture isn't too helpful
16:28 smls jnthn: Why does it need to destructure objects though?
16:28 IOninja m: dd (|bag(<a b c c>)).Capture
16:28 camelia rakudo-moar e2db7b: OUTPUT: «\(:a(1), :b(1), :c(2))␤»
16:28 * IOninja addss it to todo list
16:28 jnthn smls: huh?
16:29 timotimo it needs to do that because that's a feature of the language
16:29 smls I mean, .Map / .Hash doesn't do that either...
16:30 smls timotimo: But is it a sensible feature...?
16:30 jnthn No, I'd not expect them to
16:30 jnthn Yes, it is.
16:31 jnthn And it's done this way so that objects can implement Capture to decide who they can be destructured using signatures
16:31 jnthn *how
16:31 smls Well, I've never seen it used in practice outside of the  :key($a), :value($b)  which could be much nicer with a dedicted syntax for destructuring pairs.
16:33 jnthn m: sub foo(Complex $c (:$re, :$im)) { say $re; say $im; }; foo(2 + 3i)
16:33 camelia rakudo-moar e2db7b: OUTPUT: «2␤3␤»
16:34 jnthn Also can be useful in multi-dispatch for pattern-matching inside of objects
16:37 cibs joined #perl6
16:40 adu joined #perl6
16:41 zakharyas joined #perl6
16:41 smls jnthn: But don't you think it's strange that a torning a lone Pair into a Capture behaves so differently from other data structures containing Pairs:
16:41 smls m: say {a => 1, b => 2}.Capture;  say (a => 1, b => 2).Capture;  say (b => 2).Capture;
16:41 camelia rakudo-moar e2db7b: OUTPUT: «\(:a(1), :b(2))␤\(:a(1), :b(2))␤\(:key("b"), :value(2))␤»
16:43 jnthn smls: Arguably, though it'd be a breaking change to make it do so.
16:43 Cabanossi joined #perl6
16:44 jnthn And arguably the way it is now is consistent with Rat, Complex, and Range
16:44 jnthn So it comes down to "pick which consistent you want to be"
16:45 smls As for destructuring objects, that too could be supported with a dedicated syntax without making Mu.Capture pretend that objects are hashes.
16:45 smls E.g....
16:45 smls ($key => $value)     -- subsignature that destructures a Pair
16:45 smls (:$key($value))      -- possible alternate syntax
16:45 smls (.$im, .$re)         -- subsignature that destructures an object
16:45 smls (.im($IM), .re($RE)) -- with custom variable names
16:45 smls or something
16:46 wamba joined #perl6
16:59 jnthn It's not about pretending objects are hashes. An argument capture, represented by Capture, is well-defined as something with a positional part and a named part. A signature is something that processes a Capture. The .Capture coercer says "tell me how you'd like to look as an argument list" - and given captures exist almost exclusively to be processed by signatures it's pretty clear the resulting Capture should be useful for unpacking with a Signa
17:00 jnthn $key => $value in a signature is actually reasonable syntax for destructuring something passed as a Pair. The matter two are asking for changes to entire nature of signatures/captures and how we process them.
17:01 jnthn *latter two
17:02 smls Hm, ok
17:04 [Coke] jnthn: first long send ended at "with a Signat"
17:05 smls I guess if all value tyes were to get a .Capture that contains the value as a single positional arguemt, and all Associative types (Pair, Bag...) get a Hash-like .Capture, it would be servicable... :)
17:05 smls Except that as you said, the unfortunate Pair.Capture is already used in practice and thus can't be changed in 6.c
17:05 jnthn [Coke]: That was nearly the end: "...with a Signature."
17:06 jnthn smls: Yeah, it's also rather hard to change generally because it's a method, so what happens if the callee is 6.c and the caller is 6.d and so forth...
17:06 jnthn We might decide the breakage is worth it, though I don't have a good feel for that
17:08 jnthn Giving Bag and so on a Hash-like .Capture would make sense since they're Associative
17:11 Sound joined #perl6
17:12 girafe joined #perl6
17:13 [Coke] for masak et al: fibonacci convention this year promises to be as big as the last two, combined!
17:17 cibs joined #perl6
17:21 moritz [Coke]++ # autopun
17:22 jeek [Coke]++
17:24 cdg_ joined #perl6
17:25 * moritz just read on twitter: don't use "fortnight" as your password, it's two week
17:29 arnsholt *groan*
17:31 ChoHag joined #perl6
17:32 grondilu_ joined #perl6
17:41 st_elmo joined #perl6
17:41 alphah Hello perl 6, I'm following Grammar example from https://perlgeek.de/blog-en/per​l-6/2017-006-book-grammar.html, I'm trying to make token header matches only specific words but not able to.
17:41 alphah here is a link for my code https://gist.github.com/anonymous​/2192a932c2e03b230f92cef5e5badfbc
17:42 IOninja there's no token header in your code?
17:43 alphah token object replaced header
17:44 alphah there is a config template file as well in the pstepin link, the config file uses slightly different syntax than INI file showed in example
17:45 IOninja alphah: I don't fully understand the question. The included text file gets successfully parsed by that grammar... What's the isseu?
17:46 Geth ¦ perl6-most-wanted: 183886b829 | (Itsuki Toyota)++ | most-wanted/bindings.md
17:46 Geth ¦ perl6-most-wanted: Add a WIP module for Charting
17:46 Geth ¦ perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/183886b829
17:46 alphah my question is how to limit "object" token to match specidif words,for example <main>and <dev> match,,, but <other_word>  should not match
17:47 IOninja m: https://gist.github.com/zoffixznet​/be2ca6fb9de2318d8fece1132a4f4525
17:47 camelia rakudo-moar e2db7b: OUTPUT: «Don't know what main category is␤  in regex object at <tmp> line 17␤  in regex realm at <tmp> line 22␤  in regex TOP at <tmp> line 23␤  in block <unit> at <tmp> line 33␤␤»
17:48 IOninja m: https://gist.github.com/zoffixznet​/1e35289973657e00f4d78f17b4a68513
17:48 camelia rakudo-moar e2db7b: OUTPUT: «「<dev>␤key value␤」␤ realm => 「<dev>␤key value␤」␤  object => 「<dev>␤」␤   0 => 「dev」␤  block => 「key value␤」␤   law => 「key value␤」␤    key => 「key」␤    space => 「 」␤    value => 「value」␤»
17:48 IOninja That's one way...
17:48 IOninja The <?{...}> thing executes a piece of code and match succeeds if code's last statement's value is truthy
17:49 IOninja and || { die... } will only trigger when the previous chunk failed to parse
17:49 alphah hmm, is there a way  to do it with proto token object {*}
17:49 alphah ?
17:49 IOninja Not at the moment.
17:50 IOninja But you can just use another token...  token object-prep { <object>  || {die... } } for example
17:53 IOninja or token object { .... <section-name> .... }; token section-name { [main|dev|whatever] || {die "Don't know the section"} }
17:54 alphah I think that's good enough, I will use last one
17:54 Geth joined #perl6
17:54 alphah Thanks IOninja
17:54 buggable joined #perl6
18:02 sufrostico joined #perl6
18:11 sufrostico joined #perl6
18:11 IOninja A thought occurs...
18:12 IOninja my @a; @a[^3]»++  <-- that's not thread-safe, is it?
18:12 IOninja or my BagHash $b .= new; $b<a b c>»++
18:12 timotimo yeah, that'll grow the array in steps
18:12 timotimo that's bad news
18:13 IOninja Man
18:13 naxieAlDle ouch…
18:13 IOninja We should really come up with another op for autothreading. And leave  » unthreaded
18:13 cibs joined #perl6
18:14 moritz I'm not really convinced with need actual autothreading
18:14 moritz most operators are rather cheap, so doing them in parallel typically doesn't make much sense
18:15 IOninja Yeah
18:15 moritz is the author/owner of http://www.0racle.info/ in here? and if yes, under what nickname?
18:15 lizmat joined #perl6
18:15 naxieAlDle .seen 0racle
18:15 yoleaux I haven't seen 0racle around.
18:16 moritz ah, perlawhirl, it seems
18:16 naxieAlDle yes
18:17 naxieAlDle IOninja: I've also always disliked how » is different from map
18:17 naxieAlDle or deepmap, or whatever it actually is
18:17 IOninja heh
18:17 naxieAlDle I still can't predict what it does
18:18 naxieAlDle but it's too short, I can't get myself not to use it…
18:18 vendethiel joined #perl6
18:18 Geth ¦ doc: bduggan++ created pull request #1240: Add "Perl 6 from Python -- Nutshell" page
18:18 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1240
18:18 IOninja Sounds like you want a 1-character map...
18:19 IOninja buggable: eco 1-character map
18:19 buggable IOninja, M 'M, the 1-character Map: non-nodal, non-autothreading .map(*.some-method)': https://github.com/zoffixznet/perl6-M
18:20 Geth ¦ doc/master: 13 commits pushed by (Brian Duggan)++, (Zoffix Znet)++
18:20 Geth ¦ doc/master: review: https://github.com/perl6/doc/c​ompare/272259097d...c597301713
18:20 Geth ¦ doc/py-nutshell: 2df66cc4ac | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
18:20 Geth ¦ doc/py-nutshell: various pod and punctiation fixes and rewording
18:20 Geth ¦ doc/py-nutshell: review: https://github.com/perl6/doc/commit/2df66cc4ac
18:20 IOninja I'll fix xtest
18:20 * [Coke] glares at IOninja. :)
18:20 [Coke] danke. :)
18:20 IOninja I'm just very excited to have a Python-* doc
18:21 [Coke] 'sfine, it's 'x' for a reason.
18:22 [Coke] wow, it fails a LOT of xtest.
18:22 [Coke] note that some of the xtest test let you do "perl6 xt/foo.t path/to/file.t"
18:22 [Coke] (should make it faster to rule out the probably one file he edited.
18:24 IOninja "# & uares 79 14: uar es, uar-es," ... what are 79 14 numbers? I don't see where there's an "uares"... only \squares and squares
18:25 domidumont joined #perl6
18:26 IOninja Also gives "# & is's 50 48:" but searching for "is's" gives me nothing
18:27 IOninja oh it's in code block nevermind
18:28 IOninja class :: is Foo is Bar {}  <-- is `is` in there an operator or a trait?
18:28 domidumont1 joined #perl6
18:28 IOninja s: &infix:<is>
18:28 SourceBaby IOninja, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    infix:<is> used at line 6. Did you mean 'infix:<+|>', 'infix:<∖>', 'infix:<ne>', 'infix:<o>', 'infix:<**>'?␤␤
18:28 IOninja Trait it is...
18:28 [Coke] aye, trait.
18:29 [Coke] m: is π
18:29 camelia rakudo-moar e2db7b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    is used at line 1␤␤»
18:29 Ven joined #perl6
18:30 domidumont joined #perl6
18:31 domidumont joined #perl6
18:32 IOninja how come xt/aspell.pws is ignore? I need to a word into it (lexicographically)
18:33 IOninja in .gitignore I mean
18:34 IOninja hm, it gets updated fromsomewhere... /me looks
18:34 IOninja ah, found it. xt/words.pws
18:34 john51 joined #perl6
18:36 domidumont1 joined #perl6
18:37 IOninja what to do with `uares` thing? https://gist.github.com/zoffixznet​/4ef748ecc170dd3dc138d4f9e5f969e5
18:37 IOninja Oh, it's this line that causes it: "my \squares = [];"  what do I do
18:39 IOninja guess I'll just add uares to code.pws
18:39 Geth ¦ doc: 652347dcd8 | (Zoffix Znet)++ | 3 files
18:39 Geth ¦ doc: Fix aspell tests failures
18:39 Geth ¦ doc: review: https://github.com/perl6/doc/commit/652347dcd8
18:40 xzhao joined #perl6
18:42 Geth ¦ doc: 449c88dc95 | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6
18:42 Geth ¦ doc: Fix nbsp tests
18:42 Geth ¦ doc: review: https://github.com/perl6/doc/commit/449c88dc95
18:43 espadrine joined #perl6
18:46 IOninja Is perl6 xt/examples-compilation.t supposed to take ages without producing any output?
18:46 * IOninja realises "I'll fix xtest" really mean, I'll spam #perl6 with questions on how to fix it :P
18:47 IOninja Oh, sure, NOW it produces output -_-
18:47 timotimo it checks on IRC if you've complained yet
18:47 IOninja :)
18:49 Ven joined #perl6
18:53 domidumont joined #perl6
18:58 Cabanossi joined #perl6
18:58 Geth ¦ doc: 3417c13cf9 | (Zoffix Znet)++ | xt/space-after-commma.t
18:58 Geth ¦ doc: Make xt/space-after-commma.t report line numbers for failures
18:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3417c13cf9
18:58 movl joined #perl6
19:00 IOninja :o TIL you can use `&` instead of `|` in regexes: [ <!before ' '> & <!before $> ]
19:02 moritz or just <?before <-[ characters here]> >
19:02 Geth ¦ doc/py-nutshell-more: 6 commits pushed by (Brian Duggan)++
19:02 Geth ¦ doc/py-nutshell-more: 180e6c8ba0 | various pod and punctiation fixes and rewording
19:02 Geth ¦ doc/py-nutshell-more: 09d04ec342 | changes for aspell
19:02 Geth ¦ doc/py-nutshell-more: 8483a44d5d | move comma for xtest
19:02 Geth ¦ doc/py-nutshell-more: 08d157c373 | spaces after commas
19:02 Geth ¦ doc/py-nutshell-more: a7b9afbf23 | spelling
19:02 Geth ¦ doc/py-nutshell-more: 11d359d433 | nbsp in Perl 6
19:02 Geth ¦ doc/py-nutshell-more: review: https://github.com/perl6/doc/c​ompare/0000000000...11d359d433
19:04 [Coke] ^^ that compare is bad.
19:04 Geth ¦ doc: 6434cce19d | (Zoffix Znet)++ | xt/examples-compilation.t
19:04 Geth ¦ doc: Whitelist python docs from compilation tests
19:04 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6434cce19d
19:05 Geth ¦ doc: 2715812df4 | (Zoffix Znet)++ | xt/space-after-commma.t
19:05 Geth ¦ doc: Revert "Make xt/space-after-commma.t report line numbers for failures"
19:05 Geth ¦ doc:
19:05 Geth ¦ doc: This reverts commit 3417c13cf941009e10183a8d9dea683c676d56d0.
19:05 Geth ¦ doc:
19:05 Geth ¦ doc: It reports lines for processed doc, not original
19:05 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2715812df4
19:05 IOninja Well... I now feel sufficiently useless.
19:05 [Coke] IOninja: note that you can :skip-test for individual pod blocks in the cases where 2/3 of them are python (it's a PITA, so this is fine to get the tests clean, thanks.)
19:06 [Coke] IOninja++
19:09 [Coke] does python allow commas after spaces?
19:09 Ven joined #perl6
19:10 [Coke] if not, we can blacklist doc/Language/py-nutshell.pod6 in the comma test.
19:11 Geth ¦ doc: 17ef6722cd | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:11 Geth ¦ doc: move comma for xtest
19:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/17ef6722cd
19:13 [Coke] If that was the failure, we should rewrite the test.
19:14 xzhao joined #perl6
19:14 TimToady joined #perl6
19:14 [Coke] that doesn't pass the test.
19:15 Geth ¦ doc/py-nutshell-more: 379e364dfd | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:15 Geth ¦ doc/py-nutshell-more: Spacing, Perl 6 vs Perl 6 (nbsp)
19:15 Geth ¦ doc/py-nutshell-more: review: https://github.com/perl6/doc/commit/379e364dfd
19:16 [Coke] 17ef6722cd  can be reverted.
19:16 IOninja mhm, yeah, I think there's a confusion with the comma test. For me it reported just two lines. I think Brian is changing all the commas or something
19:17 Geth ¦ doc: 74c08b984f | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6
19:17 Geth ¦ doc: Revert "move comma for xtest"
19:17 Geth ¦ doc:
19:17 Geth ¦ doc: This reverts commit 17ef6722cdd2dde019a24b74a0e38130cfc8f083.
19:17 Geth ¦ doc: review: https://github.com/perl6/doc/commit/74c08b984f
19:17 IOninja OK. I'll run xtest from scratch and fix anything that pops up.
19:19 Geth ¦ doc: 9bd2c0113c | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6
19:19 Geth ¦ doc: Fix all the comma xtest failures
19:19 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9bd2c0113c
19:19 Geth ¦ doc/py-nutshell-more: 7a393c3aa8 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:19 Geth ¦ doc/py-nutshell-more: added back lexicographically
19:19 Geth ¦ doc/py-nutshell-more:
19:19 Geth ¦ doc/py-nutshell-more: (since it's now in our dictionary)
19:19 Geth ¦ doc/py-nutshell-more: review: https://github.com/perl6/doc/commit/7a393c3aa8
19:20 lukaramu joined #perl6
19:21 Geth ¦ doc: bduggan++ created pull request #1241: Perl 6 -> Python in a nutshell, fixes
19:21 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1241
19:22 cdg joined #perl6
19:25 Geth ¦ doc: 6c687324fa | (Zoffix Znet)++ | xt/space-after-commma.t
19:25 Geth ¦ doc: Make xt/space-after-commma.t diag() the line with the issue
19:25 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6c687324fa
19:26 [Coke] why is bd working on this on the branch while you're in mastere?
19:26 GK___1wm____SU joined #perl6
19:27 IOninja Because I jumped in to fix the issues, like a kid on sugar rush... And I guess Brian is not on IRC, so they only thing they saw is your comment on the branch I merged that it fails xtests.
19:28 [Coke] I commented on his second-PR in progress.
19:29 Ven joined #perl6
19:31 eroux joined #perl6
19:32 andrzejk_ joined #perl6
19:32 IOninja Well, my bad.
19:34 IOninja wonder what's the significance of my latest comments highlighted in light blue...
19:34 IOninja unread or something?
19:35 bdmatatu joined #perl6
19:35 IOninja http://i.imgur.com/Px95wM1.png
19:36 IOninja bdmatatu: \o
19:36 IOninja Sorry for jumping it like that. I guess I was too excited about pythong docs :)
19:36 bdmatatu Howdy!
19:36 bdmatatu No problem, sorry for the conflcts
19:37 ChoHag joined #perl6
19:40 bdmatatu I'll see if pr 1241 passes xtest before I push the commits to master.
19:40 TimToady bisect: my $x = 1,$_
19:40 bisectable6 TimToady, On both starting points (old=2015.12 new=e2db7b8) the exit code is 0 and the output is identical as well
19:40 bisectable6 TimToady, Output on both points: «»
19:40 TimToady I guess that never warned, for some reason
19:40 lizmat_ joined #perl6
19:40 TimToady m: 1,$_
19:40 camelia rakudo-moar e2db7b: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (lines 1, 1)␤»
19:40 TimToady m: 1,42
19:41 camelia rakudo-moar e2db7b: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (lines 1, 1)␤Useless use of constant integer 42 in sink context (lines 1, 1)␤»
19:41 TimToady m: $_
19:41 camelia rakudo-moar e2db7b: OUTPUT: «WARNINGS for <tmp>:␤Useless use of $_ in sink context (line 1)␤»
19:41 TimToady odd
19:41 IOninja m: dd 4.Capture
19:41 camelia rakudo-moar e2db7b: OUTPUT: «\()␤»
19:41 IOninja TimToady: would you say it'd be OK for ^ that and non-Associative Cools to do method Capture { self.list.Capture } do they don't end up empty like that?
19:42 TimToady well, the current behavior is certainly a WAT
19:42 IOninja OK
19:42 IOninja m: -> ($x) {}( 4 )
19:42 camelia rakudo-moar e2db7b: OUTPUT: «Too few positionals passed; expected 1 argument but got 0 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
19:42 IOninja ^ that would start to work.
19:42 IOninja If 4.Capture gives \(4)
19:43 TimToady that may, of course, produce other WATs if you fix it :)
19:43 IOninja hehe
19:44 TimToady maybe it should blow up instead?
19:45 IOninja Dunno. It becoming \(4) kinda follows the "anything is a 1-item list" thing.
19:45 TimToady otherwise we'll end up with a bunch of code with superstitious ()
19:45 TimToady and it'll be working for the wrong reason
19:45 IOninja Ahhh
19:45 IOninja OK. I'll give the "blow-up" approach a try first.
19:46 TimToady m: -> [$x] {}( 4 )
19:46 camelia rakudo-moar e2db7b: OUTPUT: «Type check failed in binding to '<anon>'; expected Positional but got Int (4)␤  in block <unit> at <tmp> line 1␤␤»
19:46 cdg joined #perl6
19:46 TimToady m: -> [$x] {}( [:4ty] )
19:46 camelia rakudo-moar e2db7b: OUTPUT: «Too few positionals passed; expected 1 argument but got 0 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
19:46 IOninja m: my $a but Real, Numeric;
19:46 camelia rakudo-moar e2db7b: ( no output )
19:47 TimToady we were thinking about fixing that one to not turn into a Capture, too
19:47 IOninja ^ there's a ticket for that not producing a warning: https://rt.perl.org/Ticket/Displ​ay.html?id=130213#ticket-history
19:47 TimToady I think that might be in my todo list already
19:49 Ven joined #perl6
19:50 naxieAlDle c: 2015.10,2015.11,2015.12 my $x = 1,$_
19:50 committable6 naxieAlDle, ¦2015.10,2015.11: «WARNINGS:␤Useless use of variable $_ in sink context (line 1)» ¦2015.12: «»
19:50 naxieAlDle bisect: old=2015.10 my $x = 1,$_
19:51 bisectable6 naxieAlDle, Bisecting by output (old=2015.10 new=e2db7b8) because on both starting points the exit code is 0
19:51 Geth ¦ doc: fe20283f23 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:51 Geth ¦ doc: indentation in py-nutshell
19:51 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fe20283f23
19:51 bisectable6 naxieAlDle, bisect log: https://gist.github.com/de8b​ef3c557d7a63172b6256950c3078
19:51 bisectable6 naxieAlDle, (2015-12-12) https://github.com/rakudo/rakudo/commit/​f95c14402a706579ed49abb72e749dd9fb452cf1
19:51 naxieAlDle TimToady: not sure if that's helpful, but still: ↑
19:52 IOninja bdmatatu: typo: s/Perl 6/Python/; "Decorators in Perl 6 are a way of wrapping a function in another one."
19:52 bdmatatu oops, thanks
19:53 Geth ¦ doc: 773b08a674 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:53 Geth ¦ doc: typo about decorators
19:53 Geth ¦ doc: review: https://github.com/perl6/doc/commit/773b08a674
19:54 kyan joined #perl6
19:54 integral joined #perl6
19:54 integral joined #perl6
19:55 El_Che bdmatatu: I don't know what you did in Spain in the past, but I had 3 spaniards that told me they loved your talk [on cfgmgt camp, monday an tuesday after fosdem]
19:56 bdmatatu thanks!  Have never been there actually
19:57 El_Che bdmatatu: I found it curious that they were all from Spain and not from the same group at fosdem :)
19:57 dotness joined #perl6
19:58 DrForr We had the group from Portugal and Granada, IIRC.
19:58 TimToady IOninja: btw, thanks, it was your 'my $a = $x, $x, $x;' that alerted me to the fact that it wasn't warning on $x there
20:00 El_Che DrForr: one of the guys that spoke to me was indeed from granada. On other from Capside (Perl 5) so I guess Barcelona or Madrid. The other I don't know where is was from
20:01 DrForr Barcelona probaby.
20:01 DrForr *probably
20:01 El_Che I know nothing
20:01 DrForr n/ick JonSnow
20:01 IOninja :)
20:09 Ven joined #perl6
20:10 eroux joined #perl6
20:15 lostinfog joined #perl6
20:23 lizmat joined #perl6
20:23 wamba joined #perl6
20:23 Woodi_ hi #perl6 :)
20:26 Woodi_ found in open(2) manual: openat() can be used for per-thread "current working directory": first fd for dir is opened and than used to open file in that dir: int openat(int dirfd, const char *pathname, int flags);
20:28 geekosaur good luck with portability
20:28 Woodi_ there is also  int openat(int dirfd, const char *pathname, int flags, mode_t mode);  but how they do that in C ??
20:28 geekosaur it's a syscall
20:28 geekosaur you're passing a context to the kernel's namei() for path resolution
20:28 Woodi_ geekosaur: it's _POSIX_C_SOURCE >= 200809L :)
20:29 Ven joined #perl6
20:29 geekosaur pretty sure it's *optional* in POSIX
20:30 itaipu joined #perl6
20:33 Woodi_ geekosaur: not so bad with portability, IMO  http://stackoverflow.com/questions/16701​35/what-non-linux-unixes-support-openat
20:34 geekosaur ...and how bout windows?
20:38 Woodi_ here is some "way"  http://stackoverflow.com/questions/3213852​4/is-there-a-windows-equivalent-of-openat
20:40 Woodi_ geekosaur: above I asked how they make two functions with same name but different params count... you probably answered about something else...
20:41 geekosaur oh, you mean mode_t? it's always passed to the kernel but only used if you are creating a file, so they're cheating
20:42 geekosaur it passes "garbage" (either the frame pointer or part of a local variable --- but the ABI ensures there's always *something* there so it can't trap) if you leave it off
20:43 Woodi_ I was hoping it's just macro :)
20:43 geekosaur this would be considered bad form but it's how the open*() functions in C have always worked so they just accept the poor design as something too embedded to change
20:45 geekosaur varargs macros are even worse...
20:49 Ven joined #perl6
20:49 lichtkind_ joined #perl6
20:49 IOninja wooooooooooooo fancy pants: https://perl6.vip/
20:53 * [Coke] has concerns about new perl 6 branding
20:53 [Coke] looks shiny, though!
20:54 [Coke] lesse, 4/15, I'll be safely in my new job and maybe able to perl6 again. :)
20:54 * moritz looks forward to it
20:57 IOninja [Coke]: what concerns?
20:58 geekosaur oh also C compilers in pedantic mode will warn if you leave off the parameter. (see also fcntl() which has the same behavior, get operations ignore the 3rd parameter but set-s require it)
20:58 geekosaur (C compiler developers *hate* this ancient-C-ism...)
20:59 [Coke] IOninja: well, not knowing anything about what it is, is it really a "rakudo" thing, etc.
20:59 [Coke] I know you're good about that sort of thing, so am not as worried as I could be. :)
20:59 * geekosaur apologizes for delays, 2 CL games on here :p
21:00 geekosaur (plus it means I get to play nanny for a soccer-related irc channel)
21:02 IOninja [Coke]: yeah, it'a really a rakudo thing. But no one knows what Rakudo is so I deliberately violating the distinction
21:02 Ven joined #perl6
21:02 sufrostico joined #perl6
21:03 moritz should I be seeing more than a logo and a date on that site?
21:03 IOninja nope
21:04 moritz ok
21:07 sufrosti1o joined #perl6
21:10 [Coke] IOninja: If you know you're deliberately not labelling something rakudo that is rakudo, you might want to get buyin first.
21:10 aindilis joined #perl6
21:10 [Coke] because I am sure you're going to have to have that conversation after the fact with some folks.
21:12 IOninja [Coke], what's a buyin?
21:12 moritz buy-in?
21:12 IOninja what's a buy-in?
21:12 [Coke] agreement.
21:12 [Coke] "I buy in to your argument."
21:12 Cabanossi joined #perl6
21:12 [Coke] sorry for the amerenglish.
21:13 IOninja What sort of agreement? I do not intend to break amy licensing requirements.
21:14 [Coke] IOninja: well, since I have no idea what you're doing, I can't really argue against it effectively. :)
21:15 [Coke] but the community has tried hard to keep the distinction between the rakudo compiler and the language, as you know. If this confuses that, there will no doubt be disagreements to be had. That's all. I'm not suggesting you're violating any licenses. (because I don't know what you're doing. :)
21:16 [Coke] anyway, shiny logo.
21:17 IOninja I mentioned it a few days ago. I'm making a decent Perl 6 release.
21:17 IOninja Rakudo Star that doesn't suck.
21:17 [Coke] -1 from me if it's not got Rakudo in the name.
21:17 [Coke] (FWIW)
21:18 IOninja The community seems to be deadlocked to me about what the proper release should look like, so I'm doing my own thing. If people wanna use it, great, if not fine with me.
21:18 TEttinger joined #perl6
21:18 moritz IOninja: what's your vision for it?
21:21 IOninja 2017.04.15
21:21 * IOninja &
21:21 * moritz has long been toying with the idea of a more minimalistic distribution, something like rakudo + zef + maybe some docs
21:21 moritz but so far I haven't found the motivation/tuits/whatever to actually do it
21:22 sufrostico joined #perl6
21:23 sufrosti1o joined #perl6
21:26 jnthn IMO, so long as a distribution calls itself "X Perl 6" or "Perl 6 X" and it's not being obviously gratuitous with that (like "Official Perl 6" :P) then there's enough room to keep the compiler/langauge distinction clear. Especially if it's got some kinda description like "Includes the Rakudo Perl 6 compiler, docs, and a module installer" or whatever.
21:28 El_Che moritz: that's what I do for my debs/rpms (which I use in docker and on my machines)
21:28 [Coke] jnthn++ yup, that seems reasonable.
21:38 [Coke] IOninja++ # getting stuff done
21:39 gfldex AMD made us a CPU: „At 44 cores and 1866MHz, the Naples machine has twice as much memory bandwidth as the Xeon,“
21:40 * jnthn wonders how fast that'll spectest :)
21:41 gfldex will take another 3 month to find out, sadly
21:41 jnthn And then it's probably pretty costly
21:43 Cabanossi joined #perl6
21:45 gfldex they can't be as costly as a Xeon
21:48 moritz are there even 44 core xeons?
21:48 gfldex no
21:49 bjz joined #perl6
21:51 itaipu joined #perl6
21:53 TEttinger xeon phi, though
21:56 moritz TEttinger: is that like a mixture between a CPU and a GPU?
21:56 ingy Greetings...
21:56 moritz \o ingy
21:57 ingy Is this expected: https://gist.github.com/9727​9bfa8a3dfc44bf3eea7265ff229e
21:57 TEttinger moritz: the first iteration of it was, yes. the second came out june 2016, and is I believe a normal processor (CPU)
21:57 ingy Works fine when the say line is A) not broken B) broken after 2nd heredoc
21:58 moritz ingy: looks pretty much expected to me
21:58 TEttinger "Initially in the form of PCIe-based add-on cards, a second generation product, codenamed Knights Landing was announced in June 2013. These second generation chips could be used as a standalone CPU, not just as an add-in card."
21:58 gfldex ingy: what happens if you flip the order of the markers?
21:59 moritz ingy: heredocs start in the line after the q:to, so the second q:to is part of the heredoc contents
21:59 jnthn Won't the q:to"...", "Hi", 4; be quoted as part of the first heredoc?
21:59 jnthn Right, they're about line end, not statement end
21:59 ingy I read somewhere that the content parsing starts after a newline is found
22:00 ingy oic now
22:01 ingy I didn't have a second statement
22:01 ingy so no ; required
22:01 ingy sorry my eyes were playing tricks on me
22:02 Geth ¦ doc: c9cce414a1 | (Wenzel P. P. Peppmeyer)++ | doc/Language/quoting.pod6
22:02 Geth ¦ doc: heredoc parsing is picky
22:02 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c9cce414a1
22:03 * perlpilot wonders what the P5 docs say about this
22:04 perlpilot not much apparently
22:04 perlpilot "...and all lines following the current line down to the terminating string are the value of the item."
22:04 ingy when I broke after the 2nd marker, it ran, and I saw Hi and 4 printed and thought I could split the line there
22:05 ingy but now I see what happened. sorry for the bother
22:06 as_ joined #perl6
22:06 as_ rakudo: say 4.roots;
22:06 camelia rakudo-moar e2db7b: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
22:06 as_ rakudo: say 4.roots(2);
22:06 camelia rakudo-moar e2db7b: OUTPUT: «(2+0i -2+2.44929359829471e-16i)␤»
22:07 as_ I with Complex numbers use Rats :)
22:09 cdg_ joined #perl6
22:19 dct joined #perl6
22:27 nadim joined #perl6
22:28 mcmillhj joined #perl6
22:28 IOninja m: class RatComplex is Complex { has Rat $.im; has Rat $.re; }; dd RatComplex.new(4, 0).roots: 2
22:28 camelia rakudo-moar e2db7b: OUTPUT: «(<2+0i>, <-2+2.44929359829471e-16i>).Seq␤»
22:28 IOninja Close enough :P
22:29 naxieAlDle m: say -2.5e+99-2.8e+16i
22:29 camelia rakudo-moar e2db7b: OUTPUT: «-2.5e+99-2.8e+16i␤»
22:31 IOninja m: dd 4.0.atan2: 0.0
22:31 camelia rakudo-moar e2db7b: OUTPUT: «1.5707963267949e0␤»
22:31 IOninja we'd need a ratty atan2
22:33 naxieAlDle huggable: Life, the Universe and Everything :is: -1.2e+34-5.6e+78i
22:33 huggable naxieAlDle, Added Life, the Universe and Everything as -1.2e+34-5.6e+78i
22:34 naxieAlDle oh…
22:34 naxieAlDle huggable: Life, the Universe, and Everything :is: -1.2e+34-5.6e+78i
22:34 huggable naxieAlDle, Added Life, the Universe, and Everything as -1.2e+34-5.6e+78i
22:34 SmokeMachine can I bind a Proxy inside a Variable?
22:35 IOninja m: (42+0i).roots.say
22:35 camelia rakudo-moar e2db7b: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
22:35 SmokeMachine m: my $v = Variable.new; $v.var := Proxy.new: FETCH => {42}, STORE => -> $value {}
22:35 camelia rakudo-moar e2db7b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3ew: FETCH => {42}, STORE => -> $value {}7⏏5<EOL>␤    expecting any of:␤        postfix␤»
22:35 IOninja naxieAlDle: what's it about?
22:36 naxieAlDle IOninja: nothing, just a number that scares the shit out of me
22:36 SmokeMachine better question: how can I, at compile time, set a variable to run a block and get its return as value at run time?
22:39 breinbaas joined #perl6
22:43 bdmatatu joined #perl6
22:44 mcmillhj joined #perl6
22:44 Voldenet joined #perl6
22:44 Voldenet joined #perl6
22:45 SmokeMachine m: our $val; ENTER {$val = 42}; multi trait_mod:<is>(Variable $a, :$qqq!) {$a.block.add_phaser("ENTER", {$a.var = $val})}; my $ext is qqq; say $ext # some thing like this (←) but the $val will be setted after ENTER...
22:45 camelia rakudo-moar e2db7b: OUTPUT: «42␤»
22:47 SmokeMachine m: our $val = 42; multi trait_mod:<is>(Variable $a, :$qqq!) {$a.block.add_phaser("ENTER", {$a.var = $val})}; my $ext is qqq; say $ext # like this ←
22:47 camelia rakudo-moar e2db7b: OUTPUT: «(Any)␤»
22:49 mcmillhj joined #perl6
22:57 cdg joined #perl6
23:01 sufrosti2o joined #perl6
23:04 BenGoldberg joined #perl6
23:04 sufrostico joined #perl6
23:12 bwisti joined #perl6
23:13 Cabanossi joined #perl6
23:13 mcmillhj joined #perl6
23:18 ingy moritz, jnthn: were you aware that a heredoc terminator could have a newline in it? https://gist.github.com/5220​054601da6323b465f2e7900ce059
23:19 * ingy wonders how that would play out on Win32 :)
23:23 IOninja works fine
23:25 IOninja ingy: I'll raise ya
23:25 IOninja m: say q:to/my $x = 42;␤say $x/␤Some␤  thing␤my $x = 42;␤say $x
23:25 camelia rakudo-moar e2db7b: OUTPUT: «Some␤  thing␤␤»
23:25 IOninja (bot changes ␤ to proper newline)
23:26 mst joined #perl6
23:29 IOninja m: say q:to/␤say q:to「␤say q:to'␤heh␤'␤」/␤Hello, World!␤␤say q:to「␤say q:to'␤heh␤'␤」␤
23:29 camelia rakudo-moar e2db7b: OUTPUT: «Hello, World!␤␤»
23:29 mcmillhj joined #perl6
23:29 aindilis joined #perl6
23:30 labster joined #perl6
23:33 IOninja m: say q:to/z␤say q:to「␤say q:to'␤heh␤'␤」; my $x = 'AlexDaniel';␤say "Hi", $x.comb.pick(*);␤say ":D";␤my @a = "naxialeDile".comb.shift.pop.​shuffle.squish.rand.say;␤say @a[*-$**];/␤Hi, naxieAlDle!␤z␤say q:to「␤say q:to'␤heh␤'␤」; my $x = 'AlexDaniel';␤say "Hi", $x.comb.pick(*);␤say ":D";␤my @a = "naxialeDile".comb.shift.pop.​shuffle.squish.rand.say;␤say @a[*-$**];␤
23:33 camelia rakudo-moar e2db7b: OUTPUT: «Hi, naxieAlDle!␤␤»
23:34 cschwenz joined #perl6
23:36 cschwenz so i have a variable, $info, and (via the magic of $info.perl) i have found it contains <anon|123456789098765>.new(key=>"value", ...)
23:36 cschwenz how do i access the key/value pairs inside $info?
23:37 cschwenz (as $info{"key"} does not work)
23:38 IOninja cschwenz: they're not keys. That's a class and those are attributes. Try `say $info.key`
23:38 IOninja m: class { has $.key = 'value' }.new.perl.say
23:38 camelia rakudo-moar e2db7b: OUTPUT: «<anon|78142480>.new(key => "value")␤»
23:39 cschwenz :facepalm:  thanks!
23:39 IOninja m: class { has $.key = 'value' }.new.key.say
23:39 camelia rakudo-moar e2db7b: OUTPUT: «value␤»
23:39 IOninja Yesh, the `.perl` on those sucks ATM.
23:39 cschwenz i should go to bed and tackle this in the morning.  :-P
23:40 cschwenz left #perl6
23:40 IOninja m: class { has $.key = 'value' }.new.Capture{"key"}.say
23:40 camelia rakudo-moar e2db7b: OUTPUT: «value␤»
23:40 IOninja Magic :P
23:43 Cabanossi joined #perl6
23:45 mcmillhj joined #perl6
23:51 movl joined #perl6
23:51 mcmillhj joined #perl6
23:59 cdg joined #perl6

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

Perl 6 | Reference Documentation | Rakudo