Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-17

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:06 skink What the...
00:06 skink Apparently I wrote an Argon2 module like five months ago
00:07 skink And just completely forgot about it
00:07 teatime lol
00:15 timotimo ZoffixLappy: once to see if things match, another time to get a precise error diagnostic out of the thing
00:15 timotimo ZoffixLappy: have you ever tried a say or note inside a Proxy's FETCH method?
00:15 ZoffixLappy No
00:16 ZoffixLappy timotimo, but why doesn't that happen during my Subset $x; ?
00:16 timotimo you should. it's an enlightening experience
00:16 timotimo because it happens every time we do an istype
00:16 timotimo we consider "istype" to be an extremely cheap operation
00:17 ZoffixLappy Is there some sane way to detect which... type... of call is done, just so I could print my message only once?
00:17 timotimo check the backtrace, or have a state variable
00:17 timotimo or use a once block
00:18 ZoffixLappy state and once won't work, since the subset can be used many times.
00:18 * ZoffixLappy tries the backtrace
00:18 timotimo hm.
00:21 ZoffixLappy Not sure how to "check the backtrace". Will leave this for now.
00:22 ZoffixLappy Actually, state can work: set it on first message, unset it on second message,
00:31 dalek ecosystem: 9e4b84f | (Zoffix Znet)++ | META.list:
00:31 dalek ecosystem: Add Subset::Helper
00:31 dalek ecosystem:
00:31 dalek ecosystem: Easily create subsets that sanely work with optional parameters and provide awesome error messages: https://github.com/zoffixznet/perl6-Subset-Helper
00:31 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/9e4b84fa68
00:35 ZoffixLappy m: my $s = 0; my $v := Proxy.new( FETCH => method () { note "Meow"}, STORE => method () {} ); say $v
00:35 camelia rakudo-moar 4b0e5b: OUTPUT«Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤​Meow␤Meow␤Meow␤Meow␤Meow␤Meow␤True␤»
00:35 ZoffixLappy :o
00:35 ZoffixLappy timotimo, I wasn't expecting this lol :)
00:36 ZoffixLappy This morning I was going to make a Proxy-based LWP::Simple lol. Glad I didn't waste my time.
00:36 timotimo i told you
00:36 ZoffixLappy Why does it fetch it so many times?
00:36 timotimo every time "decont" is called on it, it fetches
00:36 ZoffixLappy Ah
00:37 timotimo you could dump a backtrace every time fetch happens
00:37 timotimo that ought to be interesting
00:38 timotimo but decont, like istype, is expected to be trivial in cost; it's usually a pointer dereference or two
00:38 timotimo well, it's a c function invocation via the REPR
00:39 ZoffixLappy How do you dump a backtrace? I don't have an exception to call it on.
00:39 timotimo m: say callframe(0)
00:39 camelia rakudo-moar 4b0e5b: OUTPUT«/tmp/TNLLkCl38B at line 1␤»
00:39 timotimo you can just try { die "oh"; CATCH { ... } }
00:39 timotimo well, with a default clause, ideally
00:40 ZoffixLappy That's not too interesting :) https://gist.github.com/zoffixznet​/617a62713e83da403fbec02bbce88344
00:43 timotimo well, only callframe(0) won't be interesting
00:43 timotimo oh
00:43 timotimo you'll want --ll-exception
00:44 ZoffixLappy Same output
00:44 timotimo hum. so it is.
00:45 timotimo ah!
00:45 timotimo there's .full on the backtrace object
00:45 timotimo not too much variance
00:47 kid51 joined #perl6
00:47 timotimo leont: i trust you ran the patch in your pull request through spec tests?
00:48 * timotimo also runs spectests to verify
00:49 timotimo though i suppose it can hardly impact other spec tests, really
00:49 leont I cheated a little and only ran t/spec/S17-procasync/
00:49 ZoffixLappy :)
00:49 * ZoffixLappy learned two days ago an "unrelated" change can affect other tests :)
00:50 ZoffixLappy (this one https://github.com/rakudo/rakudo​/pull/743#issuecomment-210489723 ) That I originally ignored entirely :P
00:51 timotimo heh
00:51 leont I immediately moved on to rebasing my tap harness PR, but now I need to sleep first
00:51 timotimo have a good rest!
00:52 timotimo and thanks for your continued involvement in Tap6 and stuff!
00:53 ZoffixLappy leont++
00:56 sue joined #perl6
00:57 kurahaupo joined #perl6
00:58 mr-foobar joined #perl6
01:00 Sgeo joined #perl6
01:02 ZoffixLappy Type panda install Test::Output .... go on a Social Media excursion while the module installs... Come back... Realize you forgot to press ENTER 😂😂
01:14 timotimo i went ahead and merged it, leedo_
01:14 timotimo sorry, meant leont
01:14 timotimo but they left the channel
01:16 mr-foobar joined #perl6
01:18 skink > $encoded.decode
01:18 skink $argon2i$v=19$m=65536,t=2,p=1$D6dL87cRUdNBUkW0Rl​V+bA$wsbEjnb0zmWmxmbPNE1ZxavQfuIbo37mhThG/tfEnrw
01:18 skink Oh
01:18 skink So... that works.
01:27 kurahaupo joined #perl6
01:32 skink sortiz, Got a question you'd probably have an opinion for
01:32 kurahaupo_ joined #perl6
01:32 skink Default to returning Str for a password hash, or give the encoded Buf which you'd .decode for the Str
01:32 skink ?
01:37 kurahaupo joined #perl6
01:45 Ben_Goldberg joined #perl6
01:55 skink What the...
01:55 skink sortiz, I just ran into something that apparently you reported as a bug already :D
01:55 skink >Bytecode validation error at offset...
01:59 skink > my $hash = argon2-hash("password").decode;
01:59 skink $argon2i$v=19$m=65536,t=2,p=1$PmrqP5tZ​RGRWc4SiS9mvPA$0R9KvVCjntFHcWJNCYdrWg
01:59 skink > argon2-verify($hash, "password")
01:59 skink True
02:00 skink woo
02:09 chansen_ joined #perl6
02:16 telex joined #perl6
02:27 adhoc left #perl6
02:31 jnap_ joined #perl6
02:37 araujo__ joined #perl6
02:38 noganex joined #perl6
02:56 sortiz skink, For the password question: as the password is all ascii, returning a Str is ok.
02:57 sortiz s/password/hash/
03:10 kipd joined #perl6
03:12 p6_nb joined #perl6
03:17 clkao joined #perl6
03:21 Peter_R joined #perl6
03:23 kaare_ joined #perl6
03:29 Herby_ joined #perl6
03:29 Herby_ Evening, everyone!
03:30 Herby_ o/
03:33 Herby_ joined #perl6
03:34 hankache joined #perl6
03:35 hankache m: my @a = (1,2,3); my @b = (4,5,6); say @a == @b;
03:35 camelia rakudo-moar c4f04d: OUTPUT«True␤»
03:35 hankache :(
03:36 hankache was this always the case ?
03:40 sortiz hankache, you are comparing the number of elements.
03:42 sortiz \o Herby_
03:42 hankache sortiz yeah i just remarked, i thought it compared the also the elements inside.
03:42 hankache so what would you use to compare the elements? eq eqv or something else?
03:43 sortiz Yep, eqv
03:43 hankache thanks
03:43 sortiz Or ~~
03:44 sortiz Smart match is, well, "smart" :-)
03:44 hankache indeed :)
03:51 sortiz m: say (1,2,3) eqv (1..3), (1.2.3) ~~ (1..3) # for example
03:51 camelia rakudo-moar c4f04d: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pzwoxVq1X7␤Malformed postfix call␤at /tmp/pzwoxVq1X7:1␤------> 3say (1,2,3) eqv (1..3), (1.2.7⏏3) ~~ (1..3) # for example␤»
03:52 sortiz m: say (1,2,3) eqv (1..3), (1.2,3) ~~ (1..3) # for example
03:52 camelia rakudo-moar c4f04d: OUTPUT«FalseTrue␤»
03:53 hankache aha
03:53 hankache ~~ is "smarter" than eqv
03:55 sortiz Yep, 'cus "inside" (1..3) you have a Range.
03:56 hankache sortiz: https://github.com/hankache/perl6intro/pull/37
03:56 sjn m: say (1..3).Bag eqv (1,3,2).Bag
03:56 camelia rakudo-moar c4f04d: OUTPUT«True␤»
03:57 hankache hello sjn
03:57 sjn \o
03:58 skink Is there an efficient way to trim null bytes off an allocated buffer?
04:01 sortiz skink, if the null bytes are at the end, and you know its start position, a subbuf is ideal.
04:03 sortiz It is a common case in NC, when you give an allocated Buf to a function returning something with a max size, and the function returns the size used.
04:04 kurahaupo joined #perl6
04:06 skink Well, actually I'm not sure if that's a problem
04:06 skink m: say Blob.new(65, 66, 67, 68).decode
04:06 camelia rakudo-moar c4f04d: OUTPUT«ABCD␤»
04:06 skink m: say Blob.new(65, 66, 67, 68, 0, 0).decode
04:06 camelia rakudo-moar c4f04d: OUTPUT«ABCD␀␀␤»
04:07 skink Okay, maybe that is part of the problem
04:07 skink sortiz, The Argon2 lib has encodedlen() to determine the size of the char array you need to allocate
04:07 skink But it seems it gives too large a result
04:08 skids joined #perl6
04:08 skink hey skids
04:08 skids o/
04:09 skink I'm using the same defaults as the Python module, and can verify hashes created with that module, but that module cannot verify my outputs
04:09 skink Mine are 3char too long
04:09 sortiz m: Blob.new(65, 66, 67, 68, 0, 0).subbuf(0,4).say
04:09 camelia rakudo-moar c4f04d: OUTPUT«Blob:0x<41 42 43 44>␤»
04:09 skink 4, actually
04:10 skink sortiz, It's variable how many extra bytes it gives, though, depending on your settings
04:10 skink So I would have to scan for the position of the first null byte or something
04:11 skink But also, having the null bytes isn't adding extra chars
04:11 skink I'm not sure what's causing that
04:11 skink Oh!
04:11 skink I'm dumb.
04:13 skink My Python module is an old version which doesn't support the new API
04:13 skink That support was only added last week
04:15 Cabanossi joined #perl6
04:32 sortiz good night o/
04:36 Herby_ ZoffinWin: trying out your Twitter module
04:36 Herby_ having some issues (probably self-induced)
04:39 skink ZoffixWin, Submitted PR to add Crypt::Argon2. Already has travis set up and passing :)
04:49 Ben_Goldberg joined #perl6
04:55 kurahaupo joined #perl6
04:58 CIAvash joined #perl6
04:58 djbkd joined #perl6
05:02 geekosaur joined #perl6
05:09 molaf joined #perl6
05:11 dalek star: c36ceae | (Naoum Hankache)++ | docs/perl6intro.pdf:
05:11 dalek star: Update docs/perl6intro.pdf
05:11 dalek star: review: https://github.com/rakudo/star/commit/c36ceaea96
05:11 dalek star: 6d24982 | (Steve Mynott)++ | docs/perl6intro.pdf:
05:11 dalek star: Merge pull request #69 from hankache/master
05:11 dalek star:
05:11 dalek star: Update docs/perl6intro.pdf
05:11 dalek star: review: https://github.com/rakudo/star/commit/6d24982195
05:13 mane joined #perl6
05:52 Herby_ anyone still awake?
05:52 Herby_ messing around with this example: https://github.com/sergot/http-usera​gent/blob/master/examples/crawler.p6
05:52 skids barely
05:53 Herby_ getting an error:  Method 'for' not found for invocant of class 'List'
05:54 Herby_ its specifically the: sub get-urls    function that is throwing the error
05:54 AlexDaniel hm, what's the perl 5 equivalent for perl 6 Supply?
05:54 Herby_ AlexDaniel: o/
05:54 AlexDaniel o/
05:55 AlexDaniel Herby_: what did you mean by this “for”?
05:56 AlexDaniel Herby_: oh, you meant .map ?
05:56 geekosaur https://github.com/sergot/http-userage​nt/blob/master/examples/crawler.p6#L39
05:56 skids Herby: I bet that's suposed to be .map not .for
05:57 AlexDaniel m: say (2,3,4).for({$_ × 2})
05:57 camelia rakudo-moar c4f04d: OUTPUT«Method 'for' not found for invocant of class 'List'␤  in block <unit> at /tmp/Ez61aR1shJ line 1␤␤»
05:57 AlexDaniel m: say (2,3,4).map({$_ × 2})
05:57 camelia rakudo-moar c4f04d: OUTPUT«(4 6 8)␤»
05:57 Herby_ trying to play around with HTTP::UserAgent and copied that example, got that error
05:57 Herby_ let me try map
05:57 AlexDaniel is it an old thing or just a typo?
05:57 Herby_ it works now. thats why they pay you guys the big bucks :)
05:57 * AlexDaniel is not getting paid
05:58 geekosaur nov 2015 according to github...
05:58 skids Assuming it was ever tested :-)
05:58 AlexDaniel Herby_: also note that you can still use for, just not as a method
05:58 geekosaur I have a vague recollection that .for was an alias that got removed at some point
05:58 AlexDaniel m: say ($_ × 2 for (2,3,4))
05:58 camelia rakudo-moar c4f04d: OUTPUT«(4 6 8)␤»
05:59 AlexDaniel geekosaur: ok, then I'm not hallucinating
05:59 Herby_ AlexDaniel: i'll poke around at it, thanks
06:00 AlexDaniel it's interesting that nobody wrote an awesome error message for this case
06:00 AlexDaniel “use .map instead!”
06:00 AlexDaniel I also remember several cases when people did not know about map and were trying to do it with .for
06:01 AlexDaniel ok not several but maybe two
06:01 geekosaur I'd have to dig in the repo, but if it was there and removed then it may have been long enough ago that it went through a period with such a deprecation message before complete removal
06:01 geekosaur also I think all of those were yanked before 6.c release
06:01 AlexDaniel oooooooh
06:02 geekosaur because deprecations during prerelease were not considered relevant for the first actual release
06:02 AlexDaniel yeah, that totally makes sense
06:03 AlexDaniel still, if I stumble upon a newcomer who is trying to use “for” instead of “map” (without knowing that it ever existed) again I'll file a ticket
06:07 Herby_ the other newcomers will probably know better :)
06:07 AlexDaniel still, I'd love to know how to have “Supply” in perl 5…
06:08 AlexDaniel I'd ask that in #perl5 but I'm afraid that they will execute me if I phrase my question this way
06:08 AlexDaniel although maybe they are more friendly than I expect
06:14 djbkd joined #perl6
06:21 aries_liuxueyang joined #perl6
06:34 llfourn AlexDaniel: have you seen https://metacpan.org/pod/Mojo::EventEmitter ?
06:34 AlexDaniel llfourn: nope!
06:34 llfourn it does the job pretty well :)
06:35 llfourn obviously you need to combine it with the IO::Loop for it to be useful
06:36 AlexDaniel hmm
06:46 xiaomiao joined #perl6
06:47 cpage__ joined #perl6
06:48 AlexDani` joined #perl6
06:50 jameslen_ joined #perl6
06:52 Xliff joined #perl6
06:53 Cabanossi joined #perl6
06:54 Xliff 'lo
06:54 kipd joined #perl6
06:56 clkao joined #perl6
07:01 dolmen joined #perl6
07:03 rindolf joined #perl6
07:07 Xliff \o AlexDaniel
07:07 AlexDaniel \o/
07:08 Xliff What are you up to, this fine Sunday?
07:09 AlexDaniel programming like crazy for my thesis, haven't slept yet :) So in my mind it is not Sunday yet
07:09 * Xliff knows that feeling.
07:09 Xliff Don't wear yourself out, too much. And good luck!
07:10 AlexDaniel thanks
07:45 nine AlexDaniel: Perl 5 people are usually way more friendly than you seem to expect :)
07:46 * Xliff tries to grok out to get Pointer[Pointer[Pointer[num32]]] into something usable.
07:47 Xliff_ joined #perl6
07:47 Herby__ joined #perl6
07:47 djbkd_ joined #perl6
07:48 notostraca joined #perl6
07:49 avenj_ joined #perl6
07:51 jeek_ joined #perl6
07:54 Spot___ joined #perl6
07:54 rafl_ joined #perl6
07:54 avalenn_ joined #perl6
07:55 MadcapJake_ joined #perl6
07:57 b2gills joined #perl6
07:58 chee joined #perl6
07:58 M-tadzik joined #perl6
07:59 AlexDaniel llfourn: I ended up using a shared array of Thread::Queue's
07:59 gabiruh joined #perl6
08:02 noganex_ joined #perl6
08:03 djbkd joined #perl6
08:03 astj joined #perl6
08:05 jameslenz joined #perl6
08:05 uruwi joined #perl6
08:06 kshannon_ joined #perl6
08:06 Some-body_ joined #perl6
08:06 richi235 joined #perl6
08:06 masak_ joined #perl6
08:07 ilbelkyr joined #perl6
08:07 jdv79_ joined #perl6
08:07 lucs_ joined #perl6
08:07 perlpilot joined #perl6
08:07 jferrero_ joined #perl6
08:07 jantore_ joined #perl6
08:07 Praise- joined #perl6
08:07 Praise- joined #perl6
08:08 gtodd1 joined #perl6
08:08 nine_ joined #perl6
08:08 shmibs_ joined #perl6
08:08 kmwallio_ joined #perl6
08:08 pochi_ joined #perl6
08:09 kaare__ joined #perl6
08:10 Upasaka_ joined #perl6
08:10 Celelibi_ joined #perl6
08:11 edenc_ joined #perl6
08:11 avalenn joined #perl6
08:13 firstdayonthejob joined #perl6
08:13 M-matthew joined #perl6
08:13 M-matthew joined #perl6
08:13 Celelibi joined #perl6
08:14 ribasushi joined #perl6
08:14 Woodi joined #perl6
08:14 mls joined #perl6
08:14 m0ltar joined #perl6
08:14 domm_ joined #perl6
08:14 cgfbee joined #perl6
08:14 aindilis joined #perl6
08:16 darutoko joined #perl6
08:18 sivoais joined #perl6
08:18 sivoais joined #perl6
08:18 orbus_ joined #perl6
08:18 xnrand joined #perl6
08:18 mephinet joined #perl6
08:19 raydiak_ joined #perl6
08:20 charsbar_____ joined #perl6
08:20 Util joined #perl6
08:20 b2gills joined #perl6
08:20 jamesneko joined #perl6
08:21 zostay joined #perl6
08:21 matt_ joined #perl6
08:21 nightfrog joined #perl6
08:24 autarch joined #perl6
08:25 M-tadzik joined #perl6
08:26 Peter_R joined #perl6
08:26 masak_grrr alright.
08:27 masak_grrr I'd like to solve this SSE thing. I think it might be easier to solve it on the side, not in my existing webapp.
08:27 masak_grrr so here's my set of requirements: one route `a/` and one route `b/`, both of which respond to a GET request.
08:27 jeek joined #perl6
08:28 masak_grrr then one route `events/` which streams back server-side events, specifically `a` and `b` respectively whenever someone hits those other two routes.
08:28 masak_grrr that's all.
08:28 masak_grrr open questions as I go into this:
08:29 masak_grrr (a) can I already do this in Bailador proper? (probably not)
08:29 masak_grrr (b) if I get this to work, which levels do I have to hack? (probably HTTP::Easy or something)
08:29 masak_grrr (c) could I publish the eventual solution as an extension module to Bailador? (or will that not even be necessary?)
08:30 masak_grrr (d) can I expose my SSE response as a Channel? (I really, really hope so)
08:31 Xliff_ masak: Sorry, bud. I have yet to grok Bailador.
08:31 masak_grrr 's ok
08:31 masak_grrr I'm brain-dumping just in case *someone* has some prior art somewhere
08:31 Spot__ joined #perl6
08:31 masak_grrr actually, the most likely place to find prior art is probably CPAN
08:32 masak_grrr but I don't know if I'll be lucky enough to stumble over it
08:32 Xliff_ Moar NativeCall fun: What's the best way to get Pointer[Pointer[Pointer[num32]]] into something useful?
08:32 * masak_grrr hits the Dancer docs
08:33 Xliff_ my @outer_ap = nativecast(CArray[CArray[num32]], $pcm.deref);
08:33 Xliff_ my @chan_a = nativecast(CArray[num32], @outer_ap[i]);
08:33 Xliff_ ^^ First attempt
08:35 masak_grrr Xliff_: I'm sorry -- I'm not at all 'versed in NativeCall.
08:35 Xliff_ LOL!
08:35 Xliff_ No worries.
08:36 masak_grrr wow, Dancer is pretty cool.
08:38 * masak_grrr finds no prior art re Dancer + Server-Sent Events
08:38 Xliff_ Server-Side or Server-Sent? Or is the difference smaller than a hair?
08:40 masak_grrr I just stopped saying the (wrong) "Server-Side", and hoped no-one would notice... :P
08:40 Xliff_ =)
08:40 masak_grrr ok, wow, so I'm on my own, and breaking ground both in Perl 6 and Perl 5
08:40 masak_grrr well, let's first get this working in isolation
08:41 masak_grrr mojolicious, however: http://mojolicious.org/perldoc/Mojoliciou​s/Guides/Cookbook#EventSource-web-service
08:41 masak_grrr of course this works in mojolicious ;)
08:43 Xliff_ LOL
08:43 Xliff_ I just too a deeper look into Mojolicious, today.
08:43 Xliff_ Previously I had only explored Mojo::DOM
08:43 Xliff_ Strong stuff!
08:43 masak_grrr yeah
08:45 Xliff_ masak: http://lists.preshweb.co.uk/pipermail/​dancer-users/2013-January/002974.html
08:48 Xliff_ This one looks generic SSE
08:48 Xliff_ http://www.perlmonks.org/?node_id=1140968
08:49 masak_grrr no-one replied to that email, back in 2013
08:49 Xliff_ Yeah. Just noticed.
08:49 Xliff_ I pasted that more for the code segment in the email.
08:49 masak_grrr *nod*
08:49 masak_grrr I'm in a little bit over my head here
08:49 Xliff_ Aaaaand. THAT's all the relevant looking results I was able to pull.
08:50 Xliff_ masak_grrr, you sound like me and NativeCall! LOL! O_O
08:50 masak_grrr but I think https://github.com/ufobat/Bailador/b​lob/b1c7868200fcecd4b38a378de3e9eaf9​4b7d525b/lib/Bailador.pm#L144-L148 in Bailador is a show-stopper
08:50 masak_grrr because it presupposes a synchronously computed response content
08:50 masak_grrr which is exactly what I won't have ;)
08:50 Xliff_ oooo
08:52 masak_grrr so, either (a) patch Bailador, or (b) work around Bailador
08:52 masak_grrr seems to me (b) might be easier in the short run
08:54 Xliff_ new module contents: use Bailador; class Bailador::AsyncRoute is Bailador { # override dispatch here }
08:54 Xliff_ Maybe ?
08:57 masak_grrr yeah, something like that
08:57 masak_grrr may not go with class inheritance, because it is a little too Highlander-ish ;)
08:57 masak_grrr good or bad style: `my @params = $match.list if $match;`
08:58 masak_grrr I could write the above as `my @params = $match ?? $match.list !! ();`, but I realized I could just use the if there to do the *assignment* conditionally
08:59 Xliff_ :)
08:59 masak_grrr it's basically turning the assignment into a thunk
09:00 masak_grrr (I'm replacing the `if` statement I linked to above in a pull request)
09:02 wamba joined #perl6
09:05 masak_grrr ufobat: https://github.com/ufobat/Bailador/pull/62 :)
09:05 agentzh joined #perl6
09:05 jolts joined #perl6
09:08 Xliff_ masak_grrr, I thought you didn't want to refer to $app.response.content?
09:09 Xliff_ Or are you golfing 2 lines, there? :)
09:09 * Xliff_ used "golf" as a verb.
09:09 * Xliff_ slaps himself silly.
09:11 masak_grrr just a stylistic PR, not fixing my actual problem
09:11 masak_grrr I'm nowhere near an action plan yet, except "might skip the Bailador level on the first go"
09:17 nine_ masak_grrr: maybe you want to work with Crust instead of Bailador?
09:17 jervo joined #perl6
09:17 literal joined #perl6
09:18 avar joined #perl6
09:18 masak_grrr nine_: maybeee...?
09:18 wtw joined #perl6
09:19 masak_grrr nine_: I have a Bailador app already up and running on heroku, though. so it'd take some convincing for me to switch.
09:20 nine_ I guess combining them is not possible yet which is a shame.
09:21 masak_grrr it wouldn't be a very big conversion. I have a small app.
09:21 masak_grrr but how would it help me with SSE?
09:22 nine_ I don't know :) I haven't seen much of either Bailador or Crust. Just figured, since Bailador is very high level and doesn't support your use case and Crust is much more low level, the latter might be easier to coerce into supporting you.
09:23 masak_grrr *nod*
09:23 xinming joined #perl6
09:30 masak_grrr judging by the eg/ directory, Crust also doesn't support SSE
09:31 masak_grrr I'm sorry to say that it's not clear to me from the Crust README, test, and eg/ directory how to get started with Crust.
09:33 masak_grrr I can see that .p6sgi files play a role, but not how to run them in my application
09:36 nine_ masak_grrr: you run it with bin/crustup
09:45 masak_grrr ok...
09:45 masak_grrr I'd like to point out that that is *not* in the README
09:45 masak_grrr m: class D { method foo { say "OH HAI" }; method dispose { say "...and that is that!" } }; { my $d will leave { .dispose } = D.new; $d.foo; die "augh" }; CATCH { default { say .message } }
09:45 camelia rakudo-moar c4f04d: OUTPUT«OH HAI␤augh␤...and that is that!␤»
09:45 masak_grrr man, that is so cool.
09:46 masak_grrr I posit that 95% of the time when people want DESTROY, what they *actually* want is the above
09:46 masak_grrr we would do well to put something like the above code in a FAQ somewhere, to short-circuit the anguish for those people
09:48 infina joined #perl6
09:48 eiro joined #perl6
09:48 infina joined #perl6
09:50 spider-mario joined #perl6
09:50 masak_grrr this is my first use of `will leave` in production. yay!
10:01 avenj_ joined #perl6
10:03 keix joined #perl6
10:16 azawawi joined #perl6
10:16 azawawi hi
10:16 azawawi so how does one close an RT perl6 bug via email? :)
10:24 spider-mario yeah, tbh I find our current bug tracker quite horrible
10:24 spider-mario it feels like 1997
10:28 araujo joined #perl6
10:28 masak RT is not perfect, to be sure
10:29 masak but we're quite invested in it -- lots and lots and lots of information-rich tickets -- and I don't like "feels like 1997" as a reason to switch
10:30 RabidGravy joined #perl6
10:30 masak what teams usually do when they switch (whether to Github issues or something else) is declare ticket bankrupcy. I think that would be a shame, and a high price to pay
10:30 vendethiel well, "makes people not want to participate in it because it's so hard to access, search etc" is a good reason
10:30 masak yes, that's a better one
10:30 vendethiel declaring ticket bankrupcy would be insane, though :).
10:30 masak though it *is* very easy to send an email to rakudobug@perl.org
10:30 masak the ease of this is a big part of why I've submitted so many
10:31 masak I kinda like RT a little :) I seem to be in a minority, though
10:31 vendethiel and the reason why the UX is so horrible is probably because it's from 1997. But I know I try to avoid RT at all costs just because I can't comprehend it. Why do I get permission refused trying to see the ticket list? How do I filter by this or that? How to search by "tags" or whatever-else
10:32 masak yeah.
10:32 masak again, it's not perfect and I'm not defending RT for its technical shortcomings
10:32 masak but I'm getting a lot of value out of it, personally
10:32 masak one does get into a sort of symbiosis with the tech one uses
10:33 azawawi masak: so how does one close an RT perl6 bug via email? :)  # backtracking
10:34 masak azawawi: one doesn't. one closes a ticket via the web interface.
10:34 masak azawawi: email is only for creating the ticket.
10:34 azawawi masak: i see
10:34 masak (this is just my answer, not an "official" answer. maybe there is a way to close a ticket via email that I don't know about.)
10:35 spider-mario well, I can’t seem to reply to anything from the web interface, for example
10:36 spider-mario (also, what on earth is the difference between “respond” and “comment”?)
10:36 azawawi can someone please close https://rt.perl.org/Public/​Bug/Display.html?id=127883 ? :)
10:36 * azawawi starts reading https://raw.githubusercontent.com/perl6/do​c/rb-nutshell/doc/Language/rb-nutshell.pod
10:41 spider-mario another issue I have with only being able to report bugs via e-mail is that of privacy
10:41 spider-mario I must make sure that the From: field is properly configured in my e-mail client and that the smtp server won’t change it back
10:42 spider-mario so, I don’t know how other people feel about RT, but to me, the barrier to interaction simply feels too high to bother
10:43 spider-mario (especially if, for some reason, I can’t even reply to existing bugs)
10:44 azawawi or close them lol
10:45 azawawi it feels like 1990 to be exact :)
10:46 firstdayonthejob joined #perl6
10:46 spider-mario yeah :)
10:46 spider-mario if I click a “Respond” link, all I get is: https://i.imgur.com/ol4Sr2L.png
10:47 spider-mario that’s it
10:48 azawawi spider-mario: The thing i hate the most about RT is the concept of anonymous user and the ancient login bitcard system. It feels a lot out of age.
10:48 RabidGravy well that's weird, but on each entry on a ticket there is a 'Reply' and 'Comment' in the right top corner, both provide a form me
10:49 azawawi RabidGravy: boom :)
10:49 masak spider-mario: I've had the response a couple of times lately too.
10:49 gdo joined #perl6
10:49 masak spider-mario: I suspect it means you're not logged in.
10:49 spider-mario ah.
10:49 spider-mario that’s not very clear
10:49 masak (but yeah, as an error message, it sucks)
10:50 azawawi masak: and the cross-site forgery warning. isnt that scary? :)
10:50 masak haven't seen that.
10:50 azawawi well i have after submitting a perlbug
10:50 masak my stance is, sure, we can leave RT behind. I won't stand in the way. but I want us to have a very deliberate plan about what to move to, and how.
10:51 masak azawawi: via the web interface?
10:51 azawawi masak: yup
10:51 masak azawawi: ah, that's why. I always do email.
10:51 RabidGravy it seems that the moaning about RT comes up at least once a week, but other than the almost certain non-starter of "use github issues" no-one has actually provided a concrete and doable alternative
10:51 rvchangue joined #perl6
10:52 masak I like Github's issue system, and that would certainly lower the barrier for many people. but I'm not 100% sure Github's issue system will be a satisfactory replacement for RT.
10:52 azawawi masak: http://pasteboard.co/fFR2Q8t.png  # scary
10:52 RabidGravy yeah that's why I describe it as a non-starter
10:52 masak another component of this, of course, is that RT is written in Perl. as much as we're complaining about it, as long as we're using it, we're dogfooding.
10:53 masak azawawi: agreed; scary.
10:53 masak azawawi: also, "Referrer" should be spelled "Referer"
10:53 masak (it's "Referrer" in *English*, but "Referer" in HTTP)
10:54 * masak really hopes that's not the reason it doesn't find the header :P
10:55 RabidGravy of course if half the people complaining were to make a replacement issue tracking system in Perl 6 , arrange to have it hosted somewhere and migrate all the existing tickets, it would become someone elses problem
10:56 Ven joined #perl6
10:57 psch afair respond and comment differ by notifying the original submitter or not
10:57 azawawi RabidGravy: If you build it, they will come? :)
10:57 pmurias joined #perl6
10:57 psch although that's just preselected checkboxes that can be un-/checked anyway
10:58 pmurias masak: using a Perl 5 request tracker isn't really dogfooding Perl 6
11:00 pmurias re moving to github issues would it even be possible (someone mentions we couldn't assign ticket ownership properly on github when migrating them)
11:00 azawawi what's the status of the Perl 6 on JVM? Is it passing `make spectest`?
11:00 psch azawawi: not at all
11:02 psch although it does look a lot better than i thought...
11:02 psch well, unless i'm misreading [Coke]++'s summary https://github.com/coke/perl6-roast-data​/blob/master/log/rakudo.jvm_summary.out
11:02 arnsholt masak: I think "referrer" vs. "referer" might be a British English vs. American English thing
11:04 RabidGravy I think it's just a mis-spelling on the part of the original auther of the spec that didn't get noticed until it was too late
11:04 leont joined #perl6
11:05 gdo joined #perl6
11:07 arnsholt Or that. Being a non-native, I'm more or less incapable of keeping track of americanisms vs. britishisms
11:08 dalek doc/rb-nutshell: 27a2f72 | azawawi++ | doc/Language/rb-nutshell.pod:
11:08 dalek doc/rb-nutshell: Fix typos and Improve documentation
11:08 dalek doc/rb-nutshell: review: https://github.com/perl6/doc/commit/27a2f72fb2
11:09 azawawi RabidGravy: 81 days github contribution streak so far :)
11:10 timotimo cool :)
11:11 masak arnsholt: it's a misspelling which became spec, not a BrE/AmE distinction.
11:12 masak you're right that there are BrE/AmE distinctions like that, like "canceled"/"cancelled"
11:13 khagan joined #perl6
11:13 spider-mario wow, I had no idea about that one
11:14 nebuchadnezzar joined #perl6
11:14 nowan joined #perl6
11:15 gypsydave5 joined #perl6
11:15 Xliff__ joined #perl6
11:17 ocbtec joined #perl6
11:19 stux|RC-only joined #perl6
11:19 jnthn joined #perl6
11:19 Timbus joined #perl6
11:19 kid51 joined #perl6
11:19 M-tadzik joined #perl6
11:21 ingy joined #perl6
11:21 Vitrifur joined #perl6
11:21 pmurias masak: backlogged and read the ticket bankrupy part, that seems kind of a high price
11:23 emdashcomma joined #perl6
11:23 tinita joined #perl6
11:40 apejens joined #perl6
12:35 Emeric joined #perl6
12:39 chee joined #perl6
12:56 moritz \o
13:05 pmurias joined #perl6
13:15 RabidGravy harr
13:17 kid51 joined #perl6
13:27 rindolf joined #perl6
13:27 bent__ joined #perl6
13:28 bent__ https://www.reddit.com/r/perl6/comments/4f6jx5​/building_perl6_on_android_in_gnuroot_debian/
13:29 Xliff joined #perl6
13:29 [Coke] .seen jnthn
13:29 yoleaux I saw jnthn 15 Apr 2016 15:04Z in #perl6: <jnthn> japhb: Ah, because CPUs start in it by default for back-compat?
13:38 [Coke] s/croll end
13:40 stmuk arnsholt: I'm pretty certain RabidGravy is right about it being a mispelling
13:41 stmuk I'd never even noticed the Americans used "canceled"!
13:42 stmuk and I'd rather use github issues than RT :)
13:51 colomon joined #perl6
14:06 Actualeyes joined #perl6
14:09 Emeric How can i shuffle an array ?
14:09 Emeric m: my @l = (0, 0, 0, 1, 1, 1); @l.pick(*); say @l;
14:09 camelia rakudo-moar 617bb4: OUTPUT«[0 0 0 1 1 1]␤»
14:09 psch m: my @l = (0, 0, 0, 1, 1, 1); say @l.elems
14:09 camelia rakudo-moar 617bb4: OUTPUT«6␤»
14:10 psch ...i still occassionally get confused by that, apparently
14:10 psch m: my @l = (0, 0, 0, 1, 1, 1); say @l.pick(+@l)
14:10 camelia rakudo-moar 617bb4: OUTPUT«(0 1 1 0 1 0)␤»
14:12 psch that's interesting, though
14:12 psch ooh, no...
14:12 psch Emeric: pick doesn't mutate
14:12 psch Emeric: you can use the assign metaop for the method invocation op if you want to mutate in-place
14:13 psch m: my @l = (0, 0, 0, 1, 1, 1); say @l.=pick; say @l
14:13 camelia rakudo-moar 617bb4: OUTPUT«[0]␤[0]␤»
14:13 psch ...with * as argument, obviously
14:13 psch m: my @l = (0, 0, 0, 1, 1, 1); say @l.=pick(*); say @l
14:13 camelia rakudo-moar 617bb4: OUTPUT«[0 0 0 1 1 1]␤[0 0 0 1 1 1]␤»
14:13 psch ...just my luck
14:13 psch m: my @l = (0, 0, 0, 1, 1, 1); @l.=pick(*); say @l
14:13 camelia rakudo-moar 617bb4: OUTPUT«[1 1 0 1 0 0]␤»
14:14 buharin joined #perl6
14:14 buharin hi
14:14 buharin :)
14:14 Emeric psch: it finally works, thanks for your help !
14:14 Emeric buharin: hi :)
14:15 buharin are there any jobs in perl6?
14:15 grondilu can I not write 'class :: does (role {...}) {}'?
14:16 * grondilu wanted to experiment with roles in the REPL without polluting his namespace.
14:17 colomon joined #perl6
14:17 tharkun joined #perl6
14:17 grondilu .oO( { my role Foo {...}; class :: does Foo {...} } )
14:17 psch grondilu: you can stuff roles into lexicals as well, if that's more to your liking
14:18 grondilu m: @by differs from $by in that each criterion is applied, in order, until a non-zero (tie) result is achieved
14:18 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vUaqpwXecf␤Variable '@by' is not declared␤at /tmp/vUaqpwXecf:1␤------> 3<BOL>7⏏5@by differs from $by in that each criter␤»
14:19 grondilu oops wrong paste
14:19 grondilu m: { my role Foo { submethod BUILD { say "building" } }; class :: does Foo {}.new }
14:19 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:20 grondilu so submethods are inherited when they come from a role or something?
14:20 psch role composition isn't inheritance
14:20 psch it's more like pasting the role body into the class body
14:20 grondilu m: { my class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new }
14:20 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:20 psch m: class :: { } but role { } # if you want to have everything anon
14:20 camelia rakudo-moar 617bb4: ( no output )
14:21 psch hm, that second one shouldn't happen afaiu
14:21 grondilu m: (class :: {} but role { submethod BUILD { say "building } }).new
14:21 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Tz7efyUHv8␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/Tz7efyUHv8:1␤------> 3submethod BUILD { say "building } }).new7⏏5<EOL>␤    expecting any of:␤        argu…»
14:22 grondilu m: (class :: {} but role { submethod BUILD { say "building" } }).new
14:22 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:22 colomon joined #perl6
14:22 grondilu oh yeah this one is ok sorry
14:22 grondilu m: { my class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new }
14:22 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:23 grondilu ^but this one is dubious
14:24 psch m: class Foo { submethod BUILD { say "building" }; class :: is Foo {}.new
14:24 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VzD7_tdcfX␤'<anon|60499264>' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed)␤at /tmp/VzD7_tdcfX:1␤»
14:24 psch m: class Foo { submethod BUILD { say "building" } }; class :: is Foo {}.new
14:25 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:25 colomon joined #perl6
14:25 dolmen joined #perl6
14:25 psch m: class Foo { submethod BUILD { say "building" } }; class Bar is Foo {}.new
14:25 camelia rakudo-moar 617bb4: OUTPUT«building␤»
14:25 psch oh
14:25 psch BUILD is special 'cause its needed for construction
14:26 psch it's not that Bar.BUILD prints "building", but for Bar to be constructed, Foo has to BUILD
14:26 psch something about BUILDPLAN and BUILDALLPLAN... probably in S12, i think?
14:27 psch http://design.perl6.org/S12.html​#Construction_and_Initialization
14:27 psch m: class Foo { has $!bar; submethod BUILD(:$!bar = "baz") { }; method bar { $!bar } }; class Bar is Foo { }; say Bar.new.bar
14:27 camelia rakudo-moar 617bb4: OUTPUT«baz␤»
14:27 psch otherwise that stops working
14:28 psch grondilu: ^^^ hth
14:28 wallisds joined #perl6
14:29 colomon joined #perl6
14:29 grondilu ok
14:39 dalek doc: 3693778 | coke++ | doc/Language/concurrency.pod:
14:39 dalek doc: Add react/whenever X<>'s for Issue #134
14:39 dalek doc: review: https://github.com/perl6/doc/commit/3693778e05
14:39 dalek doc: e6c92f4 | coke++ | doc/Type/IO.pod:
14:39 dalek doc: Add missing :
14:39 dalek doc:
14:39 dalek doc: Closes RT #427
14:39 dalek doc: review: https://github.com/perl6/doc/commit/e6c92f416c
14:41 RabidGravy gah, this is really annoying
14:42 RabidGravy is it possible to somehow parameterise a role with a type capture that is not known at compile time?
14:42 RabidGravy my experiments seem to indicate this is not the case
14:44 psch m: role R[::T] { method foo { say T.^shortname } }; my $t = rand < .5 ?? Str !! Int; my $rt = R.^parameterize($t); $rt.foo
14:44 camelia rakudo-moar 617bb4: OUTPUT«Str␤»
14:44 * psch blames the AE/BE difference :P
14:46 RabidGravy ah
14:46 sue joined #perl6
14:48 RabidGravy I was doing
14:48 RabidGravy m:role Bop[::Zub] { has Zub $.bap; }; role Foo[::Bap] { has Bap $.bop; }; my $f = Str; my $d = class :: does Bop[$f] { }; my $c = class :: does Foo[$d] { }; for $c.^attributes -> $a { my $t =  $a.type; say $t; for $t.^attributes -> $a { say $a.type; } }
14:48 RabidGravy m: role Bop[::Zub] { has Zub $.bap; }; role Foo[::Bap] { has Bap $.bop; }; my $f = Str; my $d = class :: does Bop[$f] { }; my $c = class :: does Foo[$d] { }; for $c.^attributes -> $a { my $t =  $a.type; say $t; for $t.^attributes -> $a { say $a.type; } }
14:48 camelia rakudo-moar 617bb4: OUTPUT«(Any)␤»
14:53 RabidGravy m: https://gist.github.com/jonathansto​we/2205827ba7960ec6c7fa0d2095c3f853
14:53 camelia rakudo-moar 617bb4: OUTPUT«(<anon|55058800>+{Bop[Str]})␤(Str)␤»
14:54 RabidGravy which does indeed work
14:56 chenfei joined #perl6
14:57 BenGoldberg joined #perl6
14:58 khw joined #perl6
14:58 RabidGravy now to see if it works in the actual code
14:58 * grondilu wonders how he could live so long without ':set foldmethod=indent'
15:02 RabidGravy I vary on the folding
15:02 skink joined #perl6
15:02 * psch hardly ever folds
15:03 psch i usually jump between marks
15:03 skink RabidGravy, Just 'argon2' for resources doesn't find the library
15:03 RabidGravy sometimes I find I can't live without it, sometimes I find it really annoying
15:04 RabidGravy skink, let me fix that for you
15:06 * [Coke] finds that p6-doc sparse ain't awesome.
15:07 CIAvash joined #perl6
15:08 skink Ah, wait, 'libargon2'
15:08 skink does work for resources
15:09 skink It's only the suffixes it doesn't care about
15:10 RabidGravy ah, yes, I'd forgotten that part
15:12 skink 'libargon2' for meta resources and 'argon2' for %?RESOURCES, rather confusingly
15:15 luis joined #perl6
15:15 skink Pushed, RabidGravy
15:16 skink I can add OS X to travis for that
15:20 kurahaupo joined #perl6
15:21 grondilu m: (class :: { submethod BUILD { say "building" } } but role { submethod BUILD { say "mixing" } }).new
15:21 camelia rakudo-moar 617bb4: OUTPUT«building␤mixing␤»
15:21 grondilu ^happy to notice this behavior.  Can I rely on it?
15:22 Emeric1 joined #perl6
15:22 grondilu I mean the execution of *both* build submethods?
15:23 ZoffixWin Yup.
15:23 grondilu ok
15:23 skids joined #perl6
15:24 Some-body_ joined #perl6
15:25 xinming_ joined #perl6
15:26 tharkun_ joined #perl6
15:26 Skarsnik joined #perl6
15:26 khagan_ joined #perl6
15:26 [Coke] so, I'm trying to see if there's an opportunity to speed up the build on perl6-docs; it's using python to build the docs, but is trying (and failing) to use inline::python to do it.
15:27 [Coke] adding a warning so it says that it's trying and failing to use Inline::
15:28 esh joined #perl6
15:30 sue joined #perl6
15:32 dalek doc: f4be522 | coke++ | htmlify.p6:
15:32 dalek doc: Let dev know that we failed
15:32 dalek doc: review: https://github.com/perl6/doc/commit/f4be52265d
15:33 skink RabidGravy, OS X travis build passes
15:34 jjido joined #perl6
15:35 timotimo joined #perl6
15:36 dolmen CaptionBot AI about Camelia: https://twitter.com/omengue​/status/721723306185998336
15:42 Herby_ joined #perl6
15:42 Herby_ Morning, everyone!
15:42 Herby_ \0
15:44 ZoffixWin Herby_, what sort of trouble did you have with Twitter module? Granted, I barely started on it and there aren't any tests :/
15:44 cognominal so, definitively young -Ofun
15:45 [Coke] m: Inf.base(16)
15:45 camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Cannot coerce Inf or NaN to an Int␤  in block <unit> at /tmp/NXJAFvBkuW line 1␤␤Final error:␤ Type check failed in assignment to $int_part; expected Int but got Failure (Failure.new(exception...)␤  in block <unit> at /tmp/NXJA…»
15:45 [Coke] m: NaN.base(16)
15:45 camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Cannot coerce Inf or NaN to an Int␤  in block <unit> at /tmp/6km9xRn2h_ line 1␤␤Final error:␤ Type check failed in assignment to $int_part; expected Int but got Failure (Failure.new(exception...)␤  in block <unit> at /tmp/6km9…»
15:49 krakan joined #perl6
15:49 Herby_ ZoffixWin: Let me take another look at it to see what error I was getting.  Last night was another night of Percocet and Programming :)
15:50 ZoffixWin You're still taking them? Dude, they're opiates. You're probably already addicted.
15:51 Herby_ I only started with 10 total, and I'm all out :)
15:51 grondilu wow never seen this error before:
15:51 grondilu ===SORRY!===
15:51 grondilu Unknown QAST node type NQPMu
15:51 grondilu shell returned 1
15:53 [Coke] there's a few RTs with that, I think.
15:53 moritz grondilu: congratulations, you've triggered a compiler bug
15:53 rindolf joined #perl6
15:56 Herby_ zoffixwin: getting an ERROR 599: Internal Exception
15:56 Herby_ i can try and paste the error code, one sec
15:56 Actualeyes joined #perl6
15:57 Herby_ pastbin.com/qcWx4hKU
15:57 Herby_ I'm using your simple example, with my keys substituted in
15:57 Herby_ pastebin.com/qcWx4hKU
15:58 Xliff Interleved arrays and pointer math.... oh my.
15:59 Xliff Sometimes I can really dislike C APIs and libs that do things difficult.
16:03 ZoffixWin Herby_, seems like an issue with HTTP::Tinyish. Does this work:  perl6 -MHTTP::Tinyish -e 'say HTTP::Tinyish.new(agent => "Mozilla/4.0").post: "http://httpbin.org/post", headers => { "Authorization" => "blah" }, content => "foo=bar"'
16:04 ZoffixWin Oh. You're on Win10... maybe it doesn't work on it.
16:04 Herby_ running this on an lubuntu virtual box
16:05 kaare_ joined #perl6
16:05 ZoffixWin Ah
16:05 skink Xliff, I still really wanna know why this wasn't working for us http://pastebin.com/raw/QTqKtczv
16:06 skink When in the Argon2 module, using a Buf instead of a CArray worked just fine
16:07 pmurias rakudo++ # me just discovered it has version control marker detection in the grammar
16:07 kurahaupo_ joined #perl6
16:08 Herby_ zoffix: here is that command:  pastebin.com/6QdL1cpe
16:08 ZoffixWin Yup. Same error as with Twitter module. Hm.
16:09 skink (meant to s/CArray/Buf/ for the sysfunc there)
16:09 ZoffixWin Herby_, do you have `curl` installed?
16:10 * [Coke] tries to get the RT CLI working again.
16:10 ZoffixWin Seems like shelling out to curl is *still* the only method HTTP::Tinyish supports. I need to use something different in Twitter module.
16:16 BenGoldberg joined #perl6
16:19 colomon joined #perl6
16:21 pierrot joined #perl6
16:21 dogbert17 Good afternoon #perl6
16:22 dogbert17 is moritz still around?
16:23 emdashcomma_ joined #perl6
16:26 Emeric1 joined #perl6
16:27 nowan_ joined #perl6
16:27 leont_ joined #perl6
16:27 ZoffixWin was half an hour ago
16:29 dogbert17 ZoffixWin: thx, I have tried to document the samecase method and was hoping he could take a look at it
16:29 smls joined #perl6
16:31 skids1 joined #perl6
16:32 rvchangue joined #perl6
16:32 patrickz joined #perl6
16:36 ufobat joined #perl6
16:36 ufobat hi perl6
16:37 Herby_ ufobat: o/
16:37 sue joined #perl6
16:38 buharin joined #perl6
16:39 khagan joined #perl6
16:40 firstdayonthejob joined #perl6
16:41 Herby_ joined #perl6
16:47 Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep (.jpg); say @jpgs;
16:47 camelia rakudo-moar 617bb4: OUTPUT«Method 'jpg' not found for invocant of class 'Any'␤  in block <unit> at /tmp/LGrX_jBqa3 line 1␤␤»
16:47 Herby_ blah thats ugly
16:48 Herby_ $content.match(/ \s 'href="' (<-["]>+) '"' /, :g).map({ $_[0] }).grep( rx:i/^http/ )
16:48 Herby_ how would i modify that to match http links that end in .jpg
16:48 ZoffixWin Use an HTML parser? :)
16:48 colomon joined #perl6
16:49 Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep ('.jpg', @array); say @jpgs;
16:49 camelia rakudo-moar 617bb4: OUTPUT«[]␤»
16:49 Herby_ m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep (.jpg, @array); say @jpgs;
16:49 camelia rakudo-moar 617bb4: OUTPUT«Method 'jpg' not found for invocant of class 'Any'␤  in block <unit> at /tmp/pYZ3keTkRo line 1␤␤»
16:49 ZoffixWin m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep /'.jpg'/, @array; say @jpgs;
16:49 camelia rakudo-moar 617bb4: OUTPUT«[photo.jpg]␤»
16:49 ZoffixWin m: my @array = 'photo.jpg', 'doc.txt', 'page.html'; my @jpgs = grep { $_ ~~ '.jpg' }, @array; say @jpgs;
16:49 camelia rakudo-moar 617bb4: OUTPUT«[]␤»
16:49 ZoffixWin oh, well, missing // in the last one :)
16:52 ZoffixWin m: say '<a href="foo.html"></a><a href="bar.jpg"></a>'.comb: /<after 'href="'> <-["]>+/
16:52 camelia rakudo-moar 617bb4: OUTPUT«(foo.html bar.jpg)␤»
16:53 ZoffixWin Herby_, ^
16:53 Some-body_ joined #perl6
16:54 ZoffixWin m: say '<a href="foo.html"></a><a href="bar.jpg"></a>'.comb: /<after 'href="'> <-["]>+ '.jpg' <before '"'>/
16:54 camelia rakudo-moar 617bb4: OUTPUT«(bar.jpg)␤»
16:54 Herby__ joined #perl6
16:55 jnthn_ joined #perl6
16:58 Timbus_ joined #perl6
17:03 colomon joined #perl6
17:04 skink joined #perl6
17:04 skink freenode has such long timeout periods...
17:04 stux|RC-only joined #perl6
17:07 pmurias joined #perl6
17:08 skids joined #perl6
17:11 avenj_ joined #perl6
17:14 geekosaur joined #perl6
17:15 dalek ecosystem: f125369 | skinkade++ | META.list:
17:15 dalek ecosystem: Add Crypt::Argon2
17:15 dalek ecosystem:
17:15 dalek ecosystem: Friendly password-hashing on top of a libargon2 binding.
17:15 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/f125369305
17:15 dalek ecosystem: dba382f | RabidGravy++ | META.list:
17:15 dalek ecosystem: Merge pull request #196 from skinkade/patch-2
17:15 dalek ecosystem:
17:15 dalek ecosystem: Add Crypt::Argon2
17:15 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/dba382f2a0
17:26 Emeric joined #perl6
17:34 zakharyas joined #perl6
17:34 Vals joined #perl6
17:37 bent__ joined #perl6
17:38 djbkd joined #perl6
17:43 BenGoldberg joined #perl6
17:46 llfourn joined #perl6
17:51 bent__ joined #perl6
17:55 psch ZoffixWin: huh, i didn't know we had ambivalent lookahead :)
17:55 psch as in, i wasn't aware <before ...> means anything, and thought we only had <?before ...> for positive and <!before ...> for negative lookahead
17:59 psch m: grammar G { }; my \r = G.^can('before'); say r[0].name # ah
17:59 camelia rakudo-moar 617bb4: OUTPUT«before␤»
17:59 psch that's an intersting MTOWDI
18:00 psch as in, the assertion <?before foo> is equivalent to the predefined subrule <before foo>
18:00 psch s/MTOWDI/MTOWTDI/
18:02 kid51 joined #perl6
18:06 pierrot joined #perl6
18:08 timotimo Today I More'd
18:12 ZoffixWin psch, oh.. I actually mis-copied from the docs lol.
18:13 ZoffixWin I wonder if there's a difference between <after ...> and <?after ...>
18:13 timotimo shouldn't
18:13 psch ZoffixWin: i think <?after ...> is equivalent to <{? .after(...) }> or something like that
18:14 psch ZoffixWin: as in, every grammar has the predeclared rule "after", which does the lookbehind
18:15 psch and <?after ...> is a shorthead for "does the subrule with the name after the question mark match here", which i think is approximately what <?{ ."$name"(...)" }> should do
18:17 psch hm, <{? is a type, meant as <?{ :)
18:17 psch grr, s/type/typo/
18:19 timotimo <?after foobar> is the same as <?foobar> you mean?
18:25 MadcapJake Why does enc need a colon in https://github.com/perl6/doc/issues/427
18:25 timotimo because that turns it into a Pair on the LHS of the =>
18:25 timotimo and then it doesn't become a named parameter
18:25 timotimo you could also use "enc" => 'latin1' instead
18:26 timotimo that'd do the same thing
18:26 timotimo the "fix" seems wrong to me
18:27 smls m: dd (:a => 1);  say (:a => 1).key.WHAT
18:27 camelia rakudo-moar 617bb4: OUTPUT«(:a) => 1␤(Pair)␤»
18:27 smls not quite the same thing
18:27 MadcapJake m: dd (:a => 1); dd (a => 1); dd ("a" => 1)
18:27 camelia rakudo-moar 617bb4: OUTPUT«(:a) => 1␤:a(1)␤:a(1)␤»
18:27 timotimo spurt "path/to/latin1_file", "latin1 text: äöüß", enc => "latin1";
18:27 timotimo this actually already works 1:1
18:28 timotimo with the : it says
18:28 timotimo Too many positionals passed; expected 1 argument but got 2
18:28 MadcapJake timotimo: the example uses say
18:28 smls &say does not accept that named parameter (or any other that I'm aware of)
18:29 smls only positional ones
18:29 timotimo that's right, but the example is about spurt, not about say
18:29 MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", enc => 'latin1';
18:29 camelia rakudo-moar 617bb4: OUTPUT«Unexpected named parameter 'enc' passed␤  in block <unit> at /tmp/rJ4z8vL1dA line 1␤␤»
18:29 MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", :enc => 'latin1';
18:29 camelia rakudo-moar 617bb4: OUTPUT«enc_missing_colon.txtlatin1 text: äöüß(enc => True) => latin1␤»
18:29 timotimo the title of the issue is "http://doc.perl6.org/routine/spurt: example lacks ':'"
18:30 timotimo i'm going to comment on the issue
18:30 MadcapJake timotimo: you're right! the changed code is wrt spurt as well
18:31 timotimo MadcapJake: why would it need the : when using say?
18:31 timotimo when you use a : when doing it with say it *doesn't* *work*
18:31 MadcapJake timotimo: I don't know why but it does
18:31 timotimo it just spits out "(enc => True) => 'latin1'" at the end of the string
18:31 MadcapJake m: my $filename = 'enc_missing_colon.txt'; say $filename, "latin1 text: äöüß", :enc => 'latin1';
18:31 camelia rakudo-moar 617bb4: OUTPUT«enc_missing_colon.txtlatin1 text: äöüß(enc => True) => latin1␤»
18:31 timotimo that's nonsense
18:31 timotimo why would that be what you want?
18:31 MadcapJake timotimo: ahhh i thought maybe it was doing something, but you're right it's just concat'ing
18:32 smls :enc => 'latin1'   creates a pair which has another pair (enc => True) as its key
18:33 MadcapJake smls: yep, I just assumed that with it being fixed there was just some crazy mechanic that I wasn't following :)
18:33 smls the example worked fine before that commit
18:33 timotimo to be fair, the issue was opened 30 days ago; maybe the text in the docs has changed since then?
18:34 psch m: sub f(:$) { }; # i'm still wondering how to match that sig, if we are on named param weirdness vOv
18:34 camelia rakudo-moar 617bb4: ( no output )
18:34 timotimo hah, oh snap
18:34 timotimo that's mean :)
18:34 boegel joined #perl6
18:34 psch but it *is* allowed :)
18:35 psch well, actually, the mean one is the following one
18:36 psch m: sub f(:$!) { };
18:36 camelia rakudo-moar 617bb4: ( no output )
18:36 * RabidGravy finally gets a role parameterised by a parameterised role working in the actual code
18:36 timotimo MadcapJake: what's a "named pair"? :)
18:36 MadcapJake I dunno :P
18:36 RabidGravy waaaaaaaaay harder than it should have been
18:36 smls m: sub f(:$!) { say "matches" };  f;
18:36 camelia rakudo-moar 617bb4: OUTPUT«matches␤»
18:36 timotimo your explanation isn't completely accurate, either
18:36 timotimo whether or not it gets turned into a named argument isn't about whether the key is a string
18:36 psch smls++
18:36 psch neat
18:37 MadcapJake timotimo: fixed it
18:37 psch that used to not work - and arguably still shouldn't, but i don't really *want* to argue it
18:37 MadcapJake isn't it though? functions given pairs with string keys will look for named arguments with that same name
18:37 timotimo that's not true :)
18:37 timotimo let me give you an example
18:38 timotimo m: sub test(*%a) { say %a }; test hello => 1
18:38 camelia rakudo-moar 617bb4: OUTPUT«{hello => 1}␤»
18:38 psch m: my $pair = a => 1; sub f(:$a) { }; f $pair
18:38 camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub f at /tmp/VHepcaNlTn line 1␤  in block <unit> at /tmp/VHepcaNlTn line 1␤␤»
18:38 timotimo ^- that's obvious, right?
18:38 timotimo m: sub test(*%a) { say %a }; test "hello" => 1
18:38 camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub test at /tmp/eBZHGsh8TW line 1␤  in block <unit> at /tmp/eBZHGsh8TW line 1␤␤»
18:38 timotimo ^- this is what i mean
18:38 MadcapJake timotimo: ok one caveat: if a function accepts a slurpy hash, then it will first search named args THEN it will place in hash slurpy
18:38 timotimo it's a purely syntactic thing whether or not it'll end up a named argument
18:38 timotimo m: sub test(:$hello) { say $hello }; test "hello" => 1
18:38 camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub test at /tmp/yQwNH3HBNI line 1␤  in block <unit> at /tmp/yQwNH3HBNI line 1␤␤»
18:39 timotimo ^- without a slurpy, it still behaves like that
18:39 * psch is still somewhat unhappy with that
18:39 timotimo if you want to put an actual Pair object into it as a named argument, you will have to use flattening
18:39 psch but the convenient Pair constructor is unfortunately overloaded to mean named argument in some cases
18:40 timotimo the convenient pair constructor won't let you use a quoted string for names, so it's always valid for creating a named argument
18:40 MadcapJake timotimo: so you're saying that you need to specifically use unquoted pair keys or the colon form to trigger named argument checking?
18:40 timotimo yes, exactly
18:40 timotimo it's syntax on the caller's side, not semantics on the callee's side
18:40 psch m: (a => 1).WHAT.say; {$:a.WHAT.say}(a => 1)
18:40 camelia rakudo-moar 617bb4: OUTPUT«(Pair)␤(Int)␤»
18:40 smls MadcapJake: And it needs to be diretly in the argument list
18:40 psch timotimo: ^^^ that's what i mean
18:41 smls (Not inside parens or in an expression inside the argument list)
18:41 timotimo ah, the difference between an argument list and just parenthesis
18:41 smls Basically, argument lists are parsed differently than normal expressions, and that's one of the differences.
18:41 psch note, i'm not disagreeing, i understand the distinction.  it's still just think it's a bit too close together for easy access
18:42 psch s/it\'s/i/
18:42 smls Another difference is that | interpolates arguments instead of creating Slip's.
18:42 timotimo that's sufficiently ingrained into my brain already for me to not see it as a problem :)
18:42 timotimo does somebody want to revert coke's merge commit?
18:42 psch yeah, it works out if one accepts that sub invocation does things *handwave*
18:43 psch and i generally think it's a good thing we mostly have this one spot where the grammar works a bit differently
18:43 psch well, excluding all the obvious "this is a slang now", like regexen
18:43 MadcapJake timotimo: ok I updated my comment.
18:44 timotimo to me, it's not "sub invocation does things", it's a purely syntactic difference
18:45 domidumont joined #perl6
18:45 psch hm, i suppose that works too.  syntactically, inside an argument list, we're not completely in the main language anymore
18:46 MadcapJake which is why I think that a lot of the intro text in type/Signature should be elaborated upon in a language/ArgumentsParameters pod
18:47 MadcapJake or just placed in the functions pod
18:48 literal joined #perl6
18:50 domidumont joined #perl6
18:55 jjido joined #perl6
18:55 dalek doc: 4a9da56 | timotimo++ | doc/Type/IO.pod:
18:55 dalek doc: Revert "Add missing :"
18:55 dalek doc:
18:55 dalek doc: This reverts commit e6c92f416c52ca4c1a456e5cc4b1efca09ebd0af.
18:55 dalek doc:
18:55 dalek doc: As discussed in the issue #427, this wasn't correct.
18:55 dalek doc: review: https://github.com/perl6/doc/commit/4a9da56cf6
18:55 timotimo i went ahead and did it
18:58 psch timotimo++ MadcapJake++ # GH issue comments
18:59 dwarring joined #perl6
18:59 colomon joined #perl6
19:01 timotimo i added a final comment and closed the issue
19:02 ribasushi joined #perl6
19:02 timotimo interesting
19:03 skaji joined #perl6
19:03 timotimo http://doc.perl6.org/routine/say  -  see how "role IO" has a "From IO" which links to /types/IO#say, but the anchor it's supposed to link to is actually called #sub_say
19:03 timotimo anybody want to open an issue about that (if there isn't one already) while i'm AFK?
19:03 Ven joined #perl6
19:04 AlexDaniel joined #perl6
19:04 AlexDaniel how to confuse the whole perl 6 community? Just say that some example lacks a colon.
19:06 jjido AlexDaniel: for example?
19:06 AlexDaniel jjido: https://github.com/perl6/doc/issues/427
19:08 AlexDaniel jjido: also note that this was opened for 29 days :)
19:09 jjido it was a bad suggestion isn't it?
19:11 geekosaur joined #perl6
19:18 cdg joined #perl6
19:19 AlexDaniel jjido: it wasn't bad, it was just wrong :)
19:20 hankache joined #perl6
19:24 masak re RT: I'm thinking the most constructive part we can do right now is collect a list of our current woes
19:24 masak and we don't need to decide upfront whether to use that list to jump ship or to send it to the RT dev team
19:25 masak in fact, we can treat that as a superposition, which might help us stay focused and constructive
19:25 timotimo huh, i think i missed this round of the RT discussion :)
19:25 masak timotimo: http://irclog.perlgeek.de/p​erl6/2016-04-17#i_12350200
19:26 timotimo RT is all right for me
19:27 timotimo i can work it, and that's all that matters to me
19:27 masak that's about where I stand with it too. (except that I actually like some parts of it sometimes.)
19:29 patrickz joined #perl6
19:29 Emeric joined #perl6
19:29 skaji joined #perl6
19:30 Ven_ joined #perl6
19:30 BenGoldberg joined #perl6
19:32 timotimo i don't use it thoroughly enough to like parts of it :)
19:32 timotimo the amount of time i spend with the interface would only allow for shallow hatred of paper cuts and such
19:33 masak I know I have a special relationship with RT because it's happened more than once that people sigh and give up finding something using RT, and I search and I find it
19:33 ribasushi joined #perl6
19:33 pierrot joined #perl6
19:34 pecastro joined #perl6
19:34 geekosaur joined #perl6
19:38 BenGoldberg joined #perl6
19:39 ufobat joined #perl6
19:41 timotimo masak the bugbot :)
19:41 timotimo are bears good at finding stuff? is "bugbear" something demeaning to call someone?
19:41 * timotimo looks it up
19:41 timotimo oh, wow, that's not a nice thing to call someone at all
19:42 ocbtec joined #perl6
19:43 skink Is there anything I need to add to META if I have stuff in bin/?
19:43 skink for included scripts
19:44 timotimo gptrixie has an entry in its "provides" section for that, but i'm not sure that's needed
19:44 timotimo (that's just the first example i found)
19:46 skink Ah, right
19:46 timotimo no clue what other modules come with a script that gets installed
19:47 skids joined #perl6
19:51 masak I feel like an experienced developer these days. I don't make silly mistakes, and I think before I leap.
19:52 masak ...but I just wrote an off-by-one. and now I'm kicking myself over it. :P
19:52 masak I wonder if we'll ever get static analysis that can catch off-by-ones
19:53 timotimo hmm. it's not static, but if you fuzz your program and run a memory checker like valgrind or asan you'll likely be able to find a condition where you run past the end off an array when it was meant to access the last slot instead ... maybe
19:57 Exodist joined #perl6
19:58 masak in my case, I was thinking 1-based indixes for some reason, but of course they're 0-based
19:58 masak indices*
19:59 timotimo Inline::Lua is your friend, then :)
20:08 masak bleh :0
20:08 masak :)
20:14 Herby_ joined #perl6
20:24 BenGoldberg joined #perl6
20:45 Herby_ m: my @array = <1 1 2 3 3 4 5 5>; my @array = @array.unique; say @array;
20:45 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5===␤Cannot use variable @array in declaration to initialize itself␤at /tmp/zKTZeTcM2K:1␤------> 3array = <1 1 2 3 3 4 5 5>; my @array = @7⏏5array.unique; say @array;␤    expecting any of:␤        term␤Other potential diffic…»
20:46 Herby_ m: my @array = <1 1 2 3 3 4 5 5>; @array = @array.unique; say @array;
20:46 camelia rakudo-moar 617bb4: OUTPUT«[1 2 3 4 5]␤»
20:46 jjido joined #perl6
20:48 Herby_ m: set(1,2,3,5,5,3,4,6,3).list
20:48 camelia rakudo-moar 617bb4: ( no output )
20:48 Herby_ m: my @array = set(1,2,3,5,5,3,4,6,3).list; say @array;
20:48 camelia rakudo-moar 617bb4: OUTPUT«[5 => True 4 => True 3 => True 1 => True 6 => True 2 => True]␤»
20:48 Herby_ whoa
20:48 grondilu m: sub (UInt $?) {}()
20:48 camelia rakudo-moar 617bb4: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in any accepts_type at gen/moar/m-Metamodel.nqp line 3426␤  in sub  at /tmp/8aLnim7TX4 line 1␤  in block <unit> at /tmp/8aLnim7TX4 line 1␤␤»
20:49 grondilu ^should I report this bug?
20:50 grondilu m: sub (Int $?) {}()
20:50 camelia rakudo-moar 617bb4: ( no output )
20:51 skink Argon2 lets you create hashes that require 4.4 TB of RAM
20:51 skink That's completely stupid and I love it
20:51 grondilu m: subset Even of Int where * %% 2; sub (Even $?) {}()
20:51 camelia rakudo-moar 617bb4: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/MnU3IfnJov line 1␤␤»
20:52 grondilu or is it that optional arguments are not allowed with constraints?
20:52 grondilu s/arguments/parameters/
20:53 grondilu m: sub ($ where * %% 2) {}()
20:53 camelia rakudo-moar 617bb4: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in sub  at /tmp/MW9YvGhR4N line 1␤  in block <unit> at /tmp/MW9YvGhR4N line 1␤␤»
20:54 grondilu m: sub ($? where * %% 2) {}()
20:54 camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/MQVK3LkJKp line 1␤»
20:54 grondilu seems so
20:54 grondilu makes some sense, but I'm not totally convinced.
20:56 dolmen joined #perl6
20:56 grondilu m: sub ($? where True) {}()
20:56 camelia rakudo-moar 617bb4: OUTPUT«Potential difficulties:␤    Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤    at /tmp/SBznbdywD1:1␤    ------> 3sub ($? where 7⏏5True) {}()␤»
20:56 grondilu m: sub ($? where *) {}()
20:56 camelia rakudo-moar 617bb4: ( no output )
20:59 psch m: sub ($x?) {}()
20:59 camelia rakudo-moar 617bb4: ( no output )
20:59 psch m: sub ($?) {}()
20:59 camelia rakudo-moar 617bb4: ( no output )
20:59 masak 'night, #perl6
20:59 psch m: sub ($x? where * %% 2) {}()
20:59 camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/ntiiAVfoFQ line 1␤»
20:59 psch oh, yeah
21:00 psch grondilu: if you haven't, please check if it's ticketed and do so if not
21:01 psch i don't think optionals with a where constraint should have exist
21:01 psch as in, the constraint is probably checked when it shouldn't be
21:01 psch m: sub f(:$ where True) {}()
21:01 camelia rakudo-moar 617bb4: OUTPUT«Potential difficulties:␤    Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤    at /tmp/KZsbNHLUMr:1␤    ------> 3sub f(:$ where 7⏏5True) {}()␤»
21:01 psch m: sub f(:$ where * %% 2) {}()
21:01 camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/MaHl6nJF9z line 1␤»
21:02 psch ...at least it's consistent, so maybe i'm wrong :/
21:07 grondilu it's hard to justify why sub (Int $?) {}() should be ok and not sub (UInt $?) {}().  Unless we consider subsets as second-class types or something.
21:07 psch well, from an impl perspective subsets *are* second-class types
21:07 psch but that should be an implementation detail, as far as i am aware
21:08 psch m: sub f(UInt $) { }; &f.signature.say
21:08 camelia rakudo-moar 617bb4: OUTPUT«(Int $ where { ... })␤»
21:08 psch ^^^ proof
21:16 grondilu I'm confused by those error messages splitting the error in "Earlier Failure", "Final error" and sometimes: "Actually thrown at"
21:23 colomon joined #perl6
21:24 TEttinger joined #perl6
21:26 exodist_ joined #perl6
21:28 Ben_Goldberg joined #perl6
21:28 ufobat_ joined #perl6
21:28 khagan_ joined #perl6
21:29 esh_ joined #perl6
21:29 nebuchad` joined #perl6
21:29 skids1 joined #perl6
21:30 ribasushi_ joined #perl6
21:33 rvchangu- joined #perl6
21:34 Vals_ joined #perl6
21:39 ocbtec_ joined #perl6
21:43 M-tadzik joined #perl6
21:43 timotimo joined #perl6
21:46 leont joined #perl6
21:54 dpk joined #perl6
21:57 dpk left #perl6
22:01 geekosaur joined #perl6
22:05 diegok joined #perl6
22:09 RabidGravy joined #perl6
22:14 uuu_john joined #perl6
22:17 pochi joined #perl6
22:17 dogbert4711 joined #perl6
22:24 RabidGravy boom
22:28 apejens joined #perl6
22:29 firstdayonthejob joined #perl6
22:30 grondilu m: role A {}; (my %h)<foo> = my @ A; class { has A @a }.new: :a(%h<foo>)
22:30 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6DzwfjQgi3␤Two terms in a row␤at /tmp/6DzwfjQgi3:1␤------> 3role A {}; (my %h)<foo> = my @7⏏5 A; class { has A @a }.new: :a(%h<foo>)␤    expecting any of:␤        infix␤        infix stopper…»
22:31 dogbert2 joined #perl6
22:31 grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @a }.new: :a(%h<foo>)
22:31 camelia rakudo-moar 617bb4: ( no output )
22:31 grondilu wth
22:32 grondilu m: role A {}; (my \%h)<foo> = my A @; class { has A @.a }.new(:a(\%h<fo
22:32 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/N_oHALeLFw␤Malformed my␤at /tmp/N_oHALeLFw:1␤------> 3role A {}; (my7⏏5 \%h)<foo> = my A @; class { has A @.a }␤»
22:33 grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(%h<foo>)
22:33 camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤  in block <unit> at /tmp/n5uSFfPVsl line 1␤␤»
22:34 grondilu ahah
22:35 grondilu m: role A {}; class { has A @.a }.new: :a(my A @)
22:35 camelia rakudo-moar 617bb4: ( no output )
22:35 grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(%h<foo>)
22:35 camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤  in block <unit> at /tmp/px8mwmITrJ line 1␤␤»
22:35 grondilu I keep stumbling on things like that every time I try to write something.  That's very LTA
22:36 psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(|%h<foo>)
22:37 camelia rakudo-moar 617bb4: ( no output )
22:37 grondilu m: role A {}; my $foo = my A @; class { has A @.a }.new: :a($foo)
22:37 camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @!a; expected A but got Array[A] (Array[A].new())␤  in block <unit> at /tmp/Vbepv2naez line 1␤␤»
22:38 * psch doesn't see how that's surprising
22:38 grondilu m: role A {}; my $foo := my A @; class { has A @.a }.new: :a($foo)
22:38 camelia rakudo-moar 617bb4: ( no output )
22:39 psch m: role A {}; my $foo := my A @; my $bar = my A @; say $foo.WHAT; say $bar.WHAT
22:39 camelia rakudo-moar 617bb4: OUTPUT«(Array[A])␤(Array[A])␤»
22:39 psch okay, that is somewhat surprising
22:40 psch m: class A { has Str @.a }; A.new(:a(["foo", "bar"]))
22:40 camelia rakudo-moar 617bb4: ( no output )
22:40 grondilu basically I had a hash and I wanted to put a typed array in one of its entries.  Things went fine until I had to actually use this entry to affect an other typed array.
22:40 psch typed arrays are somewhat weird to handle
22:40 psch fwiw, moritz++ general advice is "better don't use typed arrays"
22:40 grondilu :/
22:41 psch which is somewhat suboptimal, and i'm probably not giving moritz enough credit here by paraphrasing it like that
22:41 grondilu m: role A {}; my A @ = my $ = my A @
22:41 camelia rakudo-moar 617bb4: OUTPUT«Type check failed in assignment to @; expected A but got Array[A] (Array[A].new())␤  in block <unit> at /tmp/sw7I1D4xdW line 1␤␤»
22:42 grondilu m: role A {}; my A @ = my $ := my A @
22:42 camelia rakudo-moar 617bb4: ( no output )
22:42 dogbert17 joined #perl6
22:43 psch ...why would you even do that
22:43 psch sorry
22:43 psch that probably comes of a bit weird
22:43 grondilu because I want to use a deep typed structure in a hash
22:43 psch right
22:43 psch well
22:43 psch context is involved there, a blot
22:43 psch -b
22:44 psch m: my @a = ^5; my $b = @a; say $b.WHAT
22:44 camelia rakudo-moar 617bb4: OUTPUT«(Array)␤»
22:44 psch m: my @a = ^5; my $b := @a; say $b.WHAT
22:44 camelia rakudo-moar 617bb4: OUTPUT«(Array)␤»
22:44 timotimo grondilu: i think when you my A @ = my $ you'll get list-assignment which will put the single A array as one item into the leftmost A array
22:44 * psch notices the example doesn't help
22:44 timotimo that's why you'd get the "expectde A but got Array[A]"
22:44 timotimo but when you := it, it won't behave as an item, because you overruled the $ semantics
22:45 timotimo and then it'll get one-argument-rule'd because it's just one iterable
22:45 timotimo and then it's fine
22:45 psch timotimo++
22:45 grondilu seems like a sensible explanation
22:45 psch that's, i think, what i was trying to find my towards
22:45 psch in general, binding cheats
22:46 psch it breaks everything that we normally use to DWIM, and skips container semantics
22:46 grondilu m: role A {}; my A @ = @(my $ = my A @)
22:46 camelia rakudo-moar 617bb4: ( no output )
22:46 grondilu m: role A {}; my $foo = my A @; class { has A @.a }.new: :a(@$foo)
22:46 camelia rakudo-moar 617bb4: ( no output )
22:47 grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@(%h<foo>))
22:47 camelia rakudo-moar 617bb4: ( no output )
22:47 grondilu m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@%h<foo>)
22:47 camelia rakudo-moar 617bb4: OUTPUT«Earlier failure:␤ Type List does not support associative indexing.␤  in block <unit> at /tmp/JgX3QPRJf1 line 1␤␤Final error:␤ Type check failed in assignment to @!a; expected A but got Failure (Failure.new(exception...)␤  in block <unit> at /tm…»
22:47 colomon joined #perl6
22:48 psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(@(%h<foo>))
22:48 camelia rakudo-moar 617bb4: ( no output )
22:48 psch well, or just slip that one
22:48 grondilu not sure about the priorities in @%h<foo>
22:48 psch m: role A {}; (my %h)<foo> = my A @; class { has A @.a }.new: :a(|%h<foo>)
22:48 camelia rakudo-moar 617bb4: ( no output )
22:48 psch postcircumfix binds looser than prefix @
22:48 psch +< >
22:49 grondilu m: role A {}; my A @ = |my $ = my A @
22:49 camelia rakudo-moar 617bb4: ( no output )
22:49 psch i don't think i'll argue whether i agree or not right now :)
22:49 grondilu the slip solution looks elegant but I'm not sure I understand it.
22:49 psch afaiu it structurally lowers the argument into the callees expectation
22:50 psch m: sub f(:$a, :$b) { say $a, $b }; my %h = a => 1, b => 2; f |%h
22:50 camelia rakudo-moar 617bb4: OUTPUT«12␤»
22:50 dogbert17 joined #perl6
22:50 psch m: sub f($, $, $) { say "three args" }; my @a = ^3; say f |@a
22:50 camelia rakudo-moar 617bb4: OUTPUT«three args␤True␤»
22:50 psch like that
22:51 psch of course, if it doesn't fit after lowering it fails to dispatch
22:51 psch m: sub f($, $, $) { say "three args" }; my @a = ^4; say f |@a
22:51 camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 3 arguments but got 4␤  in sub f at /tmp/zE6THSOwJb line 1␤  in block <unit> at /tmp/zE6THSOwJb line 1␤␤»
22:51 Xliff I'm getting a segfault when trying to execute a native C call wiht signature (float ***)
22:52 Xliff my $appp = Pointer.new();
22:52 Xliff say "Calling C routine...";
22:52 Xliff my $ret = pointerArrayTest($appp);
22:52 * psch braces for lots of pasted lines
22:52 Xliff Doesn't matter what $appp is set to, rakudo drops.
22:52 Xliff Nope. That's it. For anything more, I will pastebin
22:53 psch fwiw, i don't even understand a C signature like that... :)
22:53 Xliff Or gist... whatever
22:53 Xliff psch: Pointer to a 2d array
22:53 psch well, except with reframing it... yeah
22:53 grondilu it's a pointer to a pointer to a pointer to a float, isn't it?
22:53 timotimo rakudo drops?
22:54 Xliff Segfaults
22:54 timotimo i don't think Pointer.new will do what you want
22:54 arnsholt Yeah, I was about to say the same
22:54 Xliff 'k
22:54 timotimo you'll want to use something like malloc, or have a CArray
22:54 leont I'm observing my program dieing because Match.to isn't in the range substr($from) accepts, this is weirdness :-/
22:54 psch yeah, i'd have guessed CArray[CArray[num]] probably
22:54 arnsholt It depends entirely on what your function does, but Pointer.new is almost never going to be what you want
22:54 Xliff OK. Let me try that.
22:54 timotimo leont: it might signify a failed match
22:54 skink I'm with psch
22:54 timotimo though i think we only do that with cursors, not with match objects? not sure.
22:55 psch arnsholt: do you have any idea about NC on r-j, ooc?
22:55 timotimo i think when you Pointer.new() you're getting the default value of 0 for your pointer, so you have ... a null pointer :)
22:55 leont Well, it's in a while block, so I shouldn't be getting a failed match
22:55 psch arnsholt: it looks like getattr can't cope with inlined NativeCallBodys
22:55 Xliff timotimo, that makes sense.
22:55 Xliff So how do I pass "CArray[CArray[num32]]"?
22:56 leont while $foo.subparse($bar) -> $match { $foo.substr($match.to) }
22:56 timotimo just nativecast(TheTargetType, $thecarray)
22:56 leont Erm, second $foo should be $bar, and I should use better names in my example :-p
22:56 timotimo don't forget you'll probably have to create an inner CArray for each entry of the outer CArray
22:56 skink m: use NativeCall; my $test = CArray[CArray[num]].new; say $test.WHICH
22:57 camelia rakudo-moar 617bb4: OUTPUT«NativeCall::Types::CArray[Nativ​eCall::Types::CArray[num]]|91041912␤»
22:57 leont while $grammar.subparse($string) -> $match { $string.=substr($match.to) }
22:58 Xliff timotimo, I'm pretty sure the C-code handles initializing inner and outer array. It's the pointer to those that I'm worried about.
22:59 timotimo OK
23:00 skink Xliff, Pretty sure passing a function a CArray will always pass a pointer
23:01 timotimo yeah
23:01 Xliff Well... I keep getting this when passing an array:
23:02 Xliff Native call expected return type with CArray representation, but got a P6opaque
23:02 timotimo what do you have in the "returns"?
23:02 Xliff int32
23:02 timotimo huh
23:02 timotimo that's neither of those things
23:02 psch does the CArray have an @ sigil?
23:03 timotimo what kind of array are you passing?
23:03 Xliff Hold on. Let me fpaste it.
23:03 Xliff psch: Yes
23:03 timotimo ah, yes, that'd be trouble
23:03 timotimo unless you use := consistently with it
23:03 skink If you use $ it's more magical
23:03 skink Or something like that :)
23:03 arnsholt psch: I wrote a lot of that code, at some point. But it's been a while
23:03 timotimo hey! i have a good idea for a little commit. gimme a sec.
23:03 shadowpaste "xliff" at 217.168.150.38 pasted "NativeCall Arrays" (29 lines) at http://fpaste.scsys.co.uk/510804
23:04 arnsholt psch: From the sound of it, I think you're talking about inlined CStructs in other structs?
23:05 psch arnsholt: the gist that binding the $!call of a Sub+{Native[...]} during BUILDALLPLAN runs into getattr complaining about "trying to access a native attribute as reference attribute"
23:05 psch +is
23:06 psch arnsholt: some digging has turned up that NativeCall returns a StorageSpec.INLINED from get_storage_spec, which seems to behind the wrongly gen'd code there
23:06 psch 'cause i'm pretty sure a NativeCallBody isn't a native attribute, from a jvm perspective at least
23:06 Xliff := seems to fix the call, but now I can't get the data.
23:06 psch i have to admit i'm not great wrt JNA, so maybe i'm wrong there and the problem is somewhere else
23:06 arnsholt Yeah, that's different I think
23:07 arnsholt Could be that something changed in the internals of the JVM backend, and the NativeCall bits weren't updated to match
23:07 timotimo i just pushed a commit to MoarVM
23:08 timotimo if you git pull and make install in your moarvm folder, you should get better error messages for this case
23:08 geraud joined #perl6
23:08 timotimo oh no
23:08 timotimo never mind
23:08 timotimo argh
23:08 psch arnsholt: right, if nothing immediatly comes to mind i'll have to dig some more i suppose.. :)
23:08 arnsholt Yeah, sorry
23:09 arnsholt I think that particular bit was implemented by jnthn++ originally
23:10 * timotimo force-pushed over his blunder
23:10 pierrot joined #perl6
23:11 skink Xliff, After calling the C function, does the CArray contain nothing, or does it contain null bytes?
23:12 Xliff skink, Looking like undef bytes. I've tested this in C and it works.
23:12 Xliff s/bytes/values/
23:12 telex joined #perl6
23:13 * [Coke] sees his simple doc patch failed. whoops.
23:13 psch now, if i only had a known working git ref for NC on r-j...
23:14 * psch starts at the v6.c tag
23:14 psch maybe that works... vOv
23:15 shadowpaste "xliff" at 217.168.150.38 pasted "NativeCall Arrays #2" (26 lines) at http://fpaste.scsys.co.uk/510805
23:15 Xliff ^^ Latest version.
23:16 psch ...hardtabs
23:16 psch what kind of monster are you!? :P
23:16 Xliff What's wrong with hardtabs?
23:16 psch in all seriousness, nothing, actually
23:17 psch anyway, i take it that means the paste as-is still doesn't have useful values?
23:17 timotimo Xliff: are you aware of CArray not having a size to speak of to go with it?
23:17 Xliff Yes
23:17 timotimo ok
23:17 timotimo you may have to handle the outer CArray as an CArray[Pointer] and nativecast the individual entries to CArray[num32] or what you have
23:17 skink He said the C lib initializes the arrays
23:17 Xliff timotimo: The C call should handle allocation.
23:18 timotimo OK, but i was mostly wondering about usage rather than allocation
23:18 timotimo oh, it looks like that's what you're doing already in that paste
23:18 psch m: use NativeCall; my $r = CArray[CArray[num32]].new; say $r[0].defined
23:18 camelia rakudo-moar 617bb4: OUTPUT«False␤»
23:18 Xliff Yes. =)
23:21 skink $appp = CArray[Pointer].new() you mean timotimo?
23:22 skink Xliff, If you figure this out, it's probably worth adding to the docs
23:22 Xliff kk
23:22 wamba joined #perl6
23:22 Xliff That's odd! $appp.WHAT -> "(CArray[num32]])"
23:22 Xliff Extra ]
23:24 Xliff skink: He means "my $chan_a = nativecast(CArray[num32], $appp[$c]);"
23:27 psch m: class A { submethod BUILD { self does Real } }; A.new.WHAT.say
23:27 camelia rakudo-moar 617bb4: OUTPUT«(A+{Real})␤»
23:27 psch m: role Foo { }; class A { submethod BUILD { self does Foo } }; A.new.WHAT.say
23:27 camelia rakudo-moar 617bb4: OUTPUT«(A+{Foo})␤»
23:27 psch oh, packages have to be involved for that bug, right
23:28 psch m: role Bar::Foo { }; class A { submethod BUILD { self does Bar::Foo } }; A.new.WHAT.say
23:28 camelia rakudo-moar 617bb4: OUTPUT«(Foo})␤»
23:28 psch ^^^ that's what i suspect behind the extra ]
23:29 Xliff Ah.
23:29 Xliff After return call.... $appp is defined, but $appp[0] is not.
23:30 * psch should probably ticket that...
23:30 keix joined #perl6
23:30 Xliff ( ಠ益ಠ)
23:31 keix joined #perl6
23:32 dogbert4711 joined #perl6
23:34 psch RT #127916
23:34 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=127916
23:34 psch seems LHF-ish, but not really
23:34 psch as in, it could probably be fixed with heuristics that take better care of what to assign to $!shortname, but that's more of a bandaid solution
23:35 Xliff OK. So now no segfault (progress!) but argument passed to C-lib results in a N-OP.
23:35 Xliff It's like the call never happened, even though the return value indicates that all is OK.
23:35 psch yay, no segfault \o/
23:36 psch that means it works, ship it!
23:36 Xliff psch, I know, right!
23:36 psch ...sorry, but i don't think i have actually useful input :/
23:37 Xliff Heh! No worries. I'll continue to plug at it.
23:37 Xliff Right after I assassinate pixels.
23:37 Xliff I will probably veg on video games for a bit.
23:41 tardisx joined #perl6
23:46 ZoffixLappy joined #perl6
23:47 dogbert2 joined #perl6
23:48 BenGoldberg m: multi sub f(:$ where * %% 2) {}; f()
23:48 camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/TB4xiXYITW line 1␤Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/TB4xiXYITW line 1␤»
23:49 BenGoldberg m: multi sub f($ where * %% 2) {}; f()
23:49 camelia rakudo-moar 617bb4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/RmzE73TFSP␤Calling f() will never work with any of these multi signatures:␤    ($ where { ... })␤at /tmp/RmzE73TFSP:1␤------> 3multi sub f($ where * %% 2) {}; 7⏏5f()␤»
23:49 psch m: sub f(:$ where (*.defined && * %% 2)) {}; f()
23:49 camelia rakudo-moar 617bb4: OUTPUT«Use of uninitialized value of type Any in numeric context  in whatevercode  at /tmp/eNV5iSHJDH line 1␤»
23:49 psch that still should short-circuit at least..?
23:50 ZoffixLappy You used two args
23:50 ZoffixLappy Can't reuse * for the same arg, gotta go with $_
23:51 ZoffixLappy There's also Subset::Helper I made lastnight that avoids this issue.
23:51 ZoffixLappy Hm, short-curcuit... right. Weird
23:52 ZoffixLappy Ah, you get a WhateverCode, which is true
23:52 psch m: sub f(:$ where $_.defined && $_ %% 2) {}; f()
23:52 ZoffixLappy m: *.blah and say "meow"
23:52 camelia rakudo-moar 617bb4: OUTPUT«Constraint type check failed for parameter '<anon>'␤  in sub f at /tmp/zoetwuh45N line 1␤  in block <unit> at /tmp/zoetwuh45N line 1␤␤»
23:52 camelia rakudo-moar 617bb4: OUTPUT«meow␤»
23:52 psch that seems more reasonable, yeah
23:52 ZoffixLappy m: sub f(:$ where {.defined && $_ %% 2 }) {}; f()
23:52 camelia rakudo-moar 617bb4: OUTPUT«Constraint type check failed for parameter '<anon>'␤  in sub f at /tmp/daIhUkrNFn line 1␤  in block <unit> at /tmp/daIhUkrNFn line 1␤␤»
23:52 psch i mean, it's still weird that we can't have optionals with where constraint
23:52 ZoffixLappy where doesn't need an explicit block?
23:53 psch ...huh
23:53 psch it should, actually, i think..?
23:53 ZoffixLappy m: sub f(:$ where $_.defined && $_ %% 2) {}; f(42)
23:53 camelia rakudo-moar 617bb4: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub f at /tmp/ipw7zMMowQ line 1␤  in block <unit> at /tmp/ipw7zMMowQ line 1␤␤»
23:53 ZoffixLappy m: sub f(:$x where $_.defined && $_ %% 2) {}; f(:42x)
23:53 camelia rakudo-moar 617bb4: ( no output )
23:53 ZoffixLappy Guess not
23:53 psch neat :)

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

Perl 6 | Reference Documentation | Rakudo