Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-10-04

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:04 timotimo --debug is no problem, it just puts debug symbols in with the binary
00:04 timotimo they shouldn't impact performance
00:04 timotimo if you don't have --optimize=3, though, that'd make performance a bit weaker
00:04 labster joined #perl6
00:05 MasterDuke just rebuilt moar, nqp, and rakudo without --debug, no change
00:06 timotimo nqp and rakudo don't have --debug
00:06 MasterDuke yeah, but i couldn't remember if there were some commits i'd pulled but hadn't built yet
00:07 MasterDuke i don't think i've ever seen type_check in a profile before, much less at the top
00:07 perlawhirl joined #perl6
00:08 timotimo right
00:08 timotimo can you spot it in the call graph?
00:09 MasterDuke i'm using the qt version, let me generate some html
00:11 MasterDuke Callers: <anon> <unit-outer> <unit> <anon>
00:12 timotimo hm. weird.
00:12 timotimo anyway, i'll be going to bed, i think
00:12 BenGoldberg joined #perl6
00:13 MasterDuke actually, it seems to be in the postcircumfix:<[ ]>
00:14 timotimo weird
00:14 MasterDuke both the AT-POS and the ASSIGN-POS
00:16 MasterDuke profile is 49% specialized frames, 47% JIT-compiled
00:18 mcmillhj joined #perl6
00:37 Unavowed joined #perl6
00:47 pierre_ joined #perl6
00:49 adu joined #perl6
00:50 cyphase joined #perl6
00:52 mcmillhj joined #perl6
01:04 cyphase joined #perl6
01:04 mcmillhj joined #perl6
01:14 canopus joined #perl6
01:14 mcmillhj joined #perl6
01:17 zakharyas joined #perl6
01:31 itaipu joined #perl6
01:34 mcmillhj joined #perl6
01:36 itaipu joined #perl6
01:37 adu joined #perl6
01:46 itaipu joined #perl6
01:53 mcmillhj joined #perl6
01:59 petercommand joined #perl6
02:05 mcmillhj joined #perl6
02:08 seatek So, with panda-installed modules being named with crazy UUID-looking filenames... if I manage to find one, and fix a problem in someone's module.... how do get that module to update or recompile, or whatever needs to happen?
02:09 seatek I've got to add a column data type to the DBDish Pg thang
02:10 seatek otherwise it's nagging all the time about having no type map for a column
02:11 seatek this is a very, weirdly different feeling
02:24 Sqirrel joined #perl6
02:25 mcmillhj joined #perl6
02:26 seatek i looks like some kind of "precompiling" stuff goes on in the modules? So if you change the module source, I assume you have to kick off that precompiling again, whatever that is
02:29 llfourn seatek: that's correct
02:30 llfourn if you wanan fix a problem with the module you should clone it from github and perl6 -Ipath/to/lib
02:30 seatek is there a quick and dirty way to take a UIID-like source file you edited, and get it to "precompile", so that it will be used henceforth?
02:31 llfourn maybe but it's such a bad idea I wouldn't tell you if I knew :P
02:31 seatek lots of trouble with a biggie like DBIish
02:31 llfourn why?
02:32 llfourn (I've honestly never used it)
02:33 llfourn in any case you should just be able to -I its lib and it will use it instead of the panda installed one
02:33 llfourn it will still use the panda installed depends etc
02:41 pierre_ joined #perl6
02:47 pierre_ joined #perl6
02:48 seatek good lord that was a pain. I understand the precompiling now. That was incredibly, incredibly slow to run after using the non-precompiled.
02:48 seatek llfourn: thanks for goading me into doing what I didn't want to HAVE to do. ;)
02:48 llfourn seatek: anytime :P
02:48 seatek llfourn++
02:48 llfourn I hope you can fix the bug :)
02:49 seatek already done
02:49 seatek it's just a column type that was generating a warning all the time because oid wasn't known
02:49 llfourn seatek++ # I'm sure they'd love a PR if you haven't already
02:50 seatek i'm still irritated i couldn't edit source locally. if i get over it, I will. ;)
02:51 seatek this makes it easier having the git stuff here though already
02:51 seatek so really the pain is good
02:53 llfourn yes. You'll need to fork DBIish on github to make the PR :)
02:54 mcmillhj joined #perl6
02:54 seatek forget it then ;)
02:54 * llfourn goads seatek some more
02:56 seatek i don't think anbody but me ever uses the "money" type column in postgres anyway
02:56 seatek and maybe i should stop since Perl6 is supposedly immune to rounding errors now
02:57 seatek I don't know what to believe any more. ;)
02:57 noganex_ joined #perl6
03:03 BenGoldberg seatek, Perl6 isn't immune to rounding errors in Num, as that uses the underlying C 'double' type.  However, decimal literals such as 123.45 are not turned into Nums, they're turned into Rats (rationals), and don't get rounded.
03:05 mcmillhj joined #perl6
03:05 seatek BenGoldberg, that sounds like what I should be using
03:06 seatek Ugh. I don't even have a GitHub account. I've managed to avoid it for years.
03:06 seatek Making one now just to create a ticket with this silly little diff instead of forking the whole thing
03:11 Xliff joined #perl6
03:11 Xliff \o #perl6
03:12 Xliff I've written a STORE  method for CArray, but it doesn't seem to be getting called, rather I am getting a type mismatch error. What else do I need to do to get my code to run?
03:16 pierre_ joined #perl6
03:16 mcmillhj joined #perl6
03:29 mcmillhj joined #perl6
03:42 dalek DBIish: 0ce19e2 | (Salvador Ortiz)++ | lib/DBDish/Pg/Native.pm6:
03:42 dalek DBIish: Pg: Add simple Str support for PG type 790 (money)
03:42 dalek DBIish:
03:42 dalek DBIish: adaptiveoptics++ for the patch
03:42 dalek DBIish: Closes #71
03:42 dalek DBIish: review: https://github.com/perl6/DBIish/commit/0ce19e2e6e
03:45 cognominal joined #perl6
03:46 Lucas_One joined #perl6
03:48 pdcawley joined #perl6
03:48 Actualeyes joined #perl6
04:02 mcmillhj joined #perl6
04:05 pierre_ joined #perl6
04:06 seatek Oh wow that DBIish patch went in quick. Salvador is speedy!
04:20 pierre_ joined #perl6
04:33 mcmillhj joined #perl6
04:44 pierre_ joined #perl6
04:53 pierre_ joined #perl6
04:57 Cabanossi joined #perl6
05:10 wamba joined #perl6
05:14 ponpon joined #perl6
05:22 _slade_ joined #perl6
05:28 mcmillhj joined #perl6
05:30 ufobat joined #perl6
05:42 cibs joined #perl6
05:42 domidumont joined #perl6
05:45 sftp joined #perl6
05:45 domidumont1 joined #perl6
05:47 domidumont1 joined #perl6
05:48 mcmillhj joined #perl6
05:54 pierre_ joined #perl6
06:01 pierre_ joined #perl6
06:06 ufobat morning :)
06:09 [ptc] o/
06:18 mempko joined #perl6
06:20 sortiz joined #perl6
06:20 sortiz \o #perl6
06:23 mcmillhj joined #perl6
06:37 Zero_Dogg joined #perl6
06:37 Zero_Dogg joined #perl6
06:40 mcmillhj joined #perl6
06:43 Dunearhp joined #perl6
06:44 bjz joined #perl6
07:13 Actualeyes joined #perl6
07:13 mcmillhj joined #perl6
07:15 bjz joined #perl6
07:16 domidumont joined #perl6
07:16 * lizmat clickbaits https://p6weekly.wordpress.com/2016/10/0​3/2016-40-pull-up-to-the-hacktoberfest/
07:21 RabidGravy joined #perl6
07:25 mcmillhj joined #perl6
07:28 nadim_ joined #perl6
07:44 mcmillhj joined #perl6
07:45 dakkar joined #perl6
07:49 [ptc] lizmat++
07:50 g4 joined #perl6
07:50 g4 joined #perl6
07:55 rindolf joined #perl6
08:01 user9 joined #perl6
08:01 imcsk8 joined #perl6
08:04 ocbtec joined #perl6
08:17 eliasr joined #perl6
08:21 jnx joined #perl6
08:21 jnx Hello everyone!
08:22 jnx I'd like to ask if there's a good beginners book for Perl 6
08:23 jnx or if it's better to start with a beginners Perl 5 book
08:23 jnx If anyone could help
08:23 jnx thanks a lot
08:27 wamba joined #perl6
08:28 [ptc] jnx: I don't think there are any books as yet.  There's one in the works (https://www.reddit.com/r/perl/comm​ents/557m4k/any_new_perl_6_books/), but it's not published yet
08:29 [ptc] jnx: the docs page (https://docs.perl6.org/) has a tutorial section; there's also http://perl6intro.com/ which might be helpful
08:29 jnx I've heard abour Perl 6 Now, Perl 6 Essentials... but they seem dated
08:29 jnx maybe I'm worng
08:30 [ptc] jnx: word has it that "Perl 6 Programming" is also in the works, but I don't know how far along that is
08:30 [ptc] Perl 6 Essentials is very out of date
08:30 [ptc] there's also https://learnxinyminutes.com/docs/perl6/, which can get you up and going quickly
08:33 lizmat jnx: please note that perl6intro.com comes in many languages
08:34 lizmat alas, no chinese (yet)
08:35 jnx Thanks ptc, lizmat
08:36 jnx Maybe it's too soon and the language it's evolving
08:37 jnx so it has to be complicated
08:37 user9 joined #perl6
08:37 lizmat jnx: the stuff that the introduction is covering, is not evolving anymore
08:39 lizmat afk&
08:45 jnx ok
08:48 mcmillhj joined #perl6
09:06 bjz joined #perl6
09:09 bjz joined #perl6
09:10 wamba joined #perl6
09:16 cyphase joined #perl6
09:22 mcmillhj joined #perl6
09:26 brrt joined #perl6
09:30 bjz joined #perl6
09:31 bjz joined #perl6
09:33 mcmillhj joined #perl6
09:41 user9 joined #perl6
09:53 mcmillhj joined #perl6
09:54 gregf_ joined #perl6
10:02 zakharyas joined #perl6
10:04 fudje joined #perl6
10:07 bjz_ joined #perl6
10:13 fudje Hihi.  Anyone still awake?
10:13 fudje awake yet?
10:14 gfldex shhh, we are thinking
10:15 fudje So I've been trying to work out if it's possible to create a multi routine in a namespace, that can have candidates added from outside the class/role/module/package etc.
10:15 fudje so far the answer seems to be no.
10:15 fudje Can anyone correct me on that?
10:17 gfldex m: use MONKEY-TYPING; package P { class C {} }; augment class P::C { method m { 'oi‽' } }; say P::C.new.m
10:17 camelia rakudo-moar 01321c: OUTPUT«oi‽␤»
10:17 gfldex please note that this will kill precomp
10:18 fudje Essentially I thought it'd be cool to be able to do like module MyMod { proto decode(Str $mime, Blob $data) { * } } #`(some other file with speculative pseudocode :) multi MyMod::decode('application/json', Blob $data) { ... }
10:19 gfldex m: use MONKEY-TYPING; package P { class C { multi m(Str){ 'Str' } } }; augment class P::C { multi method m(Int) { 'oi‽' } }; say P::C.new.m('foo')
10:19 camelia rakudo-moar 01321c: OUTPUT«Cannot resolve caller m(P::C: Str); none of these signatures match:␤    (P::C $: Int, *%_)␤  in block <unit> at <tmp> line 1␤␤»
10:19 gfldex bug
10:20 gfldex m: use MONKEY-TYPING; class C { multi m(Str){ 'Str' } }; augment class C { multi method m(Int) { 'oi‽' } }; say C.new.m('foo')
10:20 camelia rakudo-moar 01321c: OUTPUT«Cannot resolve caller m(C: Str); none of these signatures match:␤    (C $: Int, *%_)␤  in block <unit> at <tmp> line 1␤␤»
10:20 jkramer When using a module with 'use-ok' in a test, it seems that subs are not exported into the tests scope. Am I doing something wrong or is this correct?
10:20 gfldex m: use MONKEY-TYPING; class C { multi method m(Str){ 'Str' } }; augment class C { multi method m(Int) { 'oi‽' } }; say C.new.m('foo')
10:20 camelia rakudo-moar 01321c: OUTPUT«Str␤»
10:20 gfldex nobug :)
10:20 RabidGravy Hmm, you can do it with a role IIRC
10:21 gfldex m: use MONKEY-TYPING; package P { class C { multi method m(Str){ 'Str' } } }; augment class P::C { multi method m(Int) { 'oi‽' } }; say C.new.m('foo')
10:21 camelia rakudo-moar 01321c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    C used at line 1␤␤»
10:21 gfldex m: use MONKEY-TYPING; package P { class C { multi method m(Str){ 'Str' } } }; augment class P::C { multi method m(Int) { 'oi‽' } }; say P::C.new.m('foo')
10:21 camelia rakudo-moar 01321c: OUTPUT«Str␤»
10:22 gfldex fudje: if you want to subclass, why not subclass?
10:23 fudje gfldex: because I *want* to abuse multidispatch in my nefarious plot ;)
10:23 gfldex you can but you wont have precomp and that hurts a lot
10:25 perlawhirl joined #perl6
10:34 ccakes joined #perl6
10:35 fudje jkramer: don't think use-ok will install symbols into the calling scope - if that's what you're trying to do?
10:36 timotimo fudje: you do know you don't have to monkey-type to abuse multi-dispatch?
10:37 fudje timotimo ???
10:38 abraxxa joined #perl6
10:39 timotimo when you subclass or mixin roles, candidates get thrown together into the same pot
10:40 ccakes joined #perl6
10:44 itaipu joined #perl6
10:47 fudje Hmm, I see....
10:51 dayangkun joined #perl6
10:53 aries_liuxueyang joined #perl6
10:57 gregf_ joined #perl6
10:57 jkramer fudje: Yeah, that's what I want. I mean I want to test if it can be used and then of course I want to test the exported subs as well
10:57 jkramer Should I put a normal use after it?
10:58 fudje jkramer: That's what's done in https://github.com/perl6/perl6-exa​mples/blob/master/t/001-example.t
11:00 matthewsellers joined #perl6
11:00 jkramer fudje: Ok, thanks
11:01 mcmillhj joined #perl6
11:02 jkramer Seems a bit pointless to me though. The normal use is done at compile-time, right? So it'll crash before the use-ok will be executed
11:02 gfldex EVAL <-- trick
11:03 bjz joined #perl6
11:04 dayangkun joined #perl6
11:05 fudje m: class Foo { our &Bar = (Callable but { proto method CALL-ME(Str) { * } }).new }; &Foo::Bar does role { multi method CALL-ME('bar') { 'baz' } }; Foo::Bar('bar')
11:05 camelia rakudo-moar 01321c: ( no output )
11:05 fudje m: class Foo { our &Bar = (Callable but { proto method CALL-ME(Str) { * } }).new }; &Foo::Bar does role { multi method CALL-ME('bar') { 'baz' } }; Foo::Bar('bar').say
11:05 camelia rakudo-moar 01321c: OUTPUT«baz␤»
11:05 fudje :D
11:09 fudje hmm the proto becomes useless in that case though.
11:12 bjz joined #perl6
11:13 bjz joined #perl6
11:14 neuraload joined #perl6
11:15 mcmillhj joined #perl6
11:24 woolfy joined #perl6
11:26 bjz joined #perl6
11:27 wamba joined #perl6
11:30 rudolfochrist joined #perl6
11:34 dalek doc: 77acc0f | gfldex++ | / (2 files):
11:34 dalek doc: allow insertion of default exception handler for example execution tests
11:34 dalek doc: review: https://github.com/perl6/doc/commit/77acc0f7ab
11:34 dalek doc: d11caf6 | gfldex++ | doc/Language/functions.pod6:
11:34 dalek doc: make examples compile
11:34 dalek doc: review: https://github.com/perl6/doc/commit/d11caf6c5a
11:37 brrt joined #perl6
11:46 mcmillhj joined #perl6
11:48 pierre_ joined #perl6
11:54 Actualeyes joined #perl6
11:59 moritz re perl6-users thread about a doc bug, I've sent the OP a commit bit :-)
11:59 ribasushi joined #perl6
12:00 gfldex moritz: can you provide a link to that thread please?
12:01 moritz gfldex: I can't, http://www.nntp.perl.org/group/perl.perl6.users/ isn't up-to-date enough, it seems
12:02 itaipu joined #perl6
12:09 grondilu joined #perl6
12:16 aries_liuxueyang joined #perl6
12:17 fudje joined #perl6
12:18 cpage__ joined #perl6
12:21 llfourn joined #perl6
12:37 zacts joined #perl6
12:39 dalek doc: 74dbf1c | gfldex++ | doc/Type/ (2 files):
12:39 dalek doc: link to subscripts
12:39 dalek doc: review: https://github.com/perl6/doc/commit/74dbf1c586
12:57 dalek doc: c2ecacb | gfldex++ | doc/Language/subscripts.pod6:
12:57 dalek doc: show * in multidim subscripts
12:57 dalek doc: review: https://github.com/perl6/doc/commit/c2ecacbc13
13:01 mcmillhj joined #perl6
13:03 zakharyas joined #perl6
13:06 rgrinberg joined #perl6
13:10 rgrinberg joined #perl6
13:13 gfldex where does projects.json reside?
13:17 canopus joined #perl6
13:26 lucasb_ joined #perl6
13:31 gfldex found it
13:33 ptolemarch joined #perl6
13:33 sufrostico joined #perl6
13:42 skids joined #perl6
13:49 seatek joined #perl6
14:00 shlomif joined #perl6
14:02 woolfy left #perl6
14:06 cdg joined #perl6
14:07 cdg joined #perl6
14:24 tatata joined #perl6
14:25 tatata Hello all, is there an object like Channel that may fail on send, what I mean: is there an object like Channel where send is a Promise? A bit like Socket::Async but without the Socket implemented
14:27 hackedNODE Nope.
14:28 moritz tatata: I think Channel can fail on send, when it's closed
14:28 hackedNODE You could setup two channels, and use the second one to signal to the first that the reception failed.
14:28 tatata moritz : I see it raises an exception
14:29 hackedNODE tatata: what do you need this for?
14:29 tatata wouldn't a Dumbo::Async class be very usefull?
14:29 moritz tatata: or you can create a Promise yourself, and put that into a Channel
14:29 hackedNODE That name is awful :)
14:30 tatata I'm trying to understand the logic behind the async and the reactive api
14:30 tatata (without finding one)
14:30 tatata but prob I'm just illiterate
14:30 hackedNODE mmkay
14:30 moritz tatata: have you read https://docs.perl6.org/language/concurrency.html
14:31 Dunearhp joined #perl6
14:31 moritz tatata: also https://design.perl6.org/S17.html might be of interested
14:31 tatata moritz yep it seems all very high level, to the point of being a nightmare
14:32 tatata why for instance Proc::Async is there?
14:32 moritz tatata: well, we have API docs for the individual classes too
14:32 moritz that's a high-level question. Didn't you just complain that the docs were too high-level? :-)
14:33 tatata I wouldn't like to complain
14:36 Khisanth joined #perl6
14:38 lizmat joined #perl6
14:43 tony-o m: (65000 / 12) * .6
14:43 camelia rakudo-moar b12297: OUTPUT«WARNINGS for <tmp>:␤Useless use of "*" in expression "(65000 / 12) * .6" in sink context (line 1)␤»
14:43 tony-o m: say (65000 / 12) * .6
14:43 camelia rakudo-moar b12297: OUTPUT«3250␤»
14:44 tony-o m: say (185000 / 12) * .6
14:44 camelia rakudo-moar b12297: OUTPUT«9250␤»
14:50 dayangkun joined #perl6
14:51 wamba joined #perl6
14:53 mcmillhj joined #perl6
14:54 gregf_ joined #perl6
14:55 neuraload joined #perl6
14:57 acrussell joined #perl6
14:57 rudolfochrist joined #perl6
15:05 dayangkun joined #perl6
15:06 b2gills joined #perl6
15:06 khw joined #perl6
15:08 telex joined #perl6
15:27 Xliff \o #perl6
15:27 Xliff I've written a STORE  method for CArray, but it doesn't seem to be getting called, rather I am getting a type mismatch error. What else do I need to do to get my code to run?
15:27 sftp joined #perl6
15:30 timotimo you can write a tiny piece of code and --target=ast to see how exactly it's getting invoked
15:30 timotimo other than that, have you tried giving us your code? even golfed if you like
15:31 rudolfochrist joined #perl6
15:42 hackedNODE seatek: why is it a wrong message? https://rt.perl.org/Ticket/Displ​ay.html?id=129768#ticket-history
15:43 hackedNODE seatek: you never fixed the first error it complained about, so it's still complaining about it.
15:45 FROGGS joined #perl6
15:46 hackedNODE m: sub MAIN (:$x, @foo) {}
15:46 camelia rakudo-moar 2a2f26: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot put required parameter @foo after variadic parameters␤at <tmp>:1␤------> 3sub MAIN (:$x, @foo7⏏5) {}␤    expecting any of:␤        constraint␤»
15:46 hackedNODE .oO( what the fuck is a variadic parameter... )
15:47 hackedNODE m: sub foo (:$x, *@foo) { dd [$x, @foo] } foo :x, ^10
15:47 camelia rakudo-moar 2a2f26: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3sub foo (:$x, *@foo) { dd [$x, @foo] }7⏏5 foo :x, ^10␤    expecting any of:␤        infix␤        infix stopper␤  …»
15:47 hackedNODE m: sub foo (:$x, *@foo) { dd [$x, @foo] }; foo :x, ^10
15:47 camelia rakudo-moar 2a2f26: OUTPUT«[Bool::True, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]␤»
15:47 hackedNODE seatek: never mind. I see it now
15:48 FROGGS o/
15:49 [Coke] hackedNODE: I'm guessing CS-pretentious way of saying optional?
15:50 hackedNODE Well, the docs say variadic params are slurpies: https://docs.perl6.org/type/Signature#Slurpy_%28A.K.A._Variadic%29_Parameters
15:50 hackedNODE Which makes even less sense, since I wouldn't call :$x slurpy
15:50 hackedNODE And `variadic` isn't even in the dictionary. Kinda LTA if you ask me.
15:50 [Coke] https://en.wikipedia.org/wiki/Variadic
15:51 hackedNODE I see
15:52 TimToady basically, you should be able to find the positions of the positional parameters easily, and it's not easy if you have any optional parameters before the positional ones
15:53 RabidGravy It's in my dictionary :)
15:53 RabidGravy grep -i variadic /usr/share/dict/words
15:53 RabidGravy variadic
15:53 hackedNODE RabidGravy: and what's the definition? :)
15:54 grondilu hello #perl6
15:54 lostinfog joined #perl6
15:54 grondilu m: (sub f($) {})(f($))
15:54 camelia rakudo-moar 2a2f26: ( no output )
15:54 grondilu ^I'm slightly surprised this is ok
15:55 hackedNODE grondilu: why? A sub can call itself without issues
15:55 TimToady it should probably read: Cannot put positional parameter @foo after optional or slurpy parameters
15:55 grondilu yeah but I thought it was out of scope
15:55 awwaiid I don't think parens make a scope
15:55 TimToady two different $ there
15:55 awwaiid only curleys
15:55 grondilu awwaiid: true
15:56 [Coke] grondilu: no different scope wise than : sub f($) {} ; f($)
15:56 TimToady those are not the same $
15:56 dalek doc: 758b7ac | (Zoffix Znet)++ | doc/Type/Signature.pod6:
15:56 dalek doc: Add note on what "variadic" is and pop into index
15:56 dalek doc: review: https://github.com/perl6/doc/commit/758b7ac36a
15:57 hackedNODE By default subs are our scoped
15:57 TimToady or yeah, parens don't make a scope, if that's the issue
15:57 TimToady hackedNODE: no, they are my scoped
15:57 hackedNODE huh
15:57 hackedNODE Oh, I'm confused with classes
15:58 awwaiid yeah, I ran into that when trying to call a package's sub from outside. Gotta 'our' it
15:58 TimToady yes, that requires 'our', or an export from a module
15:58 TimToady or some other kind of alias to the outer scope
15:58 hackedNODE TimToady: oh, I left you a bot message in #perl6-dev :)
15:58 awwaiid ya
16:01 grondilu joined #perl6
16:01 acrussell joined #perl6
16:06 cdg joined #perl6
16:18 wamba joined #perl6
16:19 seatek hackedNODE, sorry was away - yeah, it was just a definition for a variable type associated with a Pg column data type that needed to be added to make the warnings disappear
16:20 brrt joined #perl6
16:26 lizmat joined #perl6
16:33 _slade_ joined #perl6
16:33 hackedNODE yeah, I'll try to fix that some time by Tuesday
16:38 rgrinberg joined #perl6
16:39 wamba joined #perl6
16:40 cdg joined #perl6
16:44 seatek hackedNODE, oh I thought you were talking about the patch I sent for DBIish - but you were talking about the error message vagueness with the variadoc parameters. Yeah, that came about when I was silli-ly trying to associate a default value list, with the slurpy list part. Which would be handy, but I imagine might be weird to actually cope with (and is better handled in the method itself). I mean, you could
16:44 seatek put everything and the kitchen sink into the parameter stuff, but it's good it gets cut off somewhere.
16:44 brrt joined #perl6
16:45 hackedNODE I actually think defaults on slurpies would be handy. And I'm yet to get any answer for why they're not supported :)
16:46 hackedNODE sub foo (*@files = 'default-file') {...}
16:46 seatek yeah that's what i natually felt it could do
16:46 seatek but it couldn't
16:48 hackedNODE I guess I can see why: you can't not-specify a slurpy, so it doesn't know when to give it a default. It's just my thinking was to apply the default if the slurpy ends up empty.
16:50 dalek doc: a8e3008 | (Garrett Goebel)++ | doc/Type/List.pod6:
16:50 dalek doc: #926 produce method is not documented
16:50 dalek doc: Add documentation for produce based on reduce
16:50 dalek doc: review: https://github.com/perl6/doc/commit/a8e3008c39
16:50 dalek doc: bf0331b | (Garrett Goebel)++ | doc/Type/List.pod6:
16:50 dalek doc: found and fixed typo
16:50 dalek doc: review: https://github.com/perl6/doc/commit/bf0331b917
16:50 dalek doc: e730384 | RabidGravy++ | doc/Type/List.pod6:
16:50 dalek doc: Merge pull request #936 from ggoebel/master
16:50 dalek doc:
16:50 dalek doc: Issue #926 produce method is not documented
16:50 dalek doc: review: https://github.com/perl6/doc/commit/e730384805
16:50 seatek that's what i though -- that it must not instantiate the list unless there is something there... but you always have to check if something is there.... so why not check if there is some default.... ? :)
16:51 hackedNODE m: sub foo (@files = 'default-file') { dd @files }([])
16:51 camelia rakudo-moar 392d21: OUTPUT«[]␤»
16:53 seatek hmm
16:53 seatek :)
16:53 hackedNODE Yeah. It's only when the param is missing entirely that the default would kick in
16:54 hackedNODE Actually, there's a way to workaround it
16:54 hackedNODE m: sub foo (*@files where { $^v.push: "default-value" unless $^v; True } ) { dd @files }()
16:54 camelia rakudo-moar 392d21: OUTPUT«["default-value"]␤»
16:54 hackedNODE m: sub foo (*@files where { $^v.push: "default-value" unless $^v; True } ) { dd @files }(1, 2, 3)
16:54 camelia rakudo-moar 392d21: OUTPUT«[1, 2, 3]␤»
16:56 seatek i refuse. i'll just do it in the method ;)
16:56 hackedNODE m: sub foo (*@files where $_ || .push: "default-value" ) { dd @files }()
16:56 camelia rakudo-moar 392d21: OUTPUT«["default-value"]␤»
16:57 hackedNODE Well, you can also do this:
16:57 hackedNODE m: subset Default where $_ || .push: "default value"; sub foo (Default *@files) { dd @files }()
16:57 camelia rakudo-moar 392d21: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Slurpy positional parameters with type constraints are not supported␤at <tmp>:1␤------> 3default value"; sub foo (Default *@files7⏏5) { dd @files }()␤    expecting any of:␤        constraint␤»
16:57 hackedNODE oh... :)
16:57 seatek all these crazy new syntaxes... i found myself yesterday doing this:  for @row -> ($var1, $var2, $var3) {}   instead of just doing the easy ($var1, $var2, $var3) = @rows   like we've always done.
16:58 seatek i think i have a sprained brain
16:59 hackedNODE m: sub infix:<¯\_(ツ)_/¯> { @_.join }; say "What " ¯\_(ツ)_/¯ "crazy new syntaxes?"
16:59 camelia rakudo-moar 392d21: OUTPUT«What crazy new syntaxes?␤»
17:00 eliasr joined #perl6
17:01 hackedNODE m: sub 𝕹𝖊𝖛𝖊𝖗-𝖍𝖊𝖆𝖗𝖉-𝖔𝖋-𝖙𝖍𝖊𝖒 { &?BLOCK.name.say }()
17:01 camelia rakudo-moar 392d21: OUTPUT«𝕹𝖊𝖛𝖊𝖗-𝖍𝖊𝖆𝖗𝖉-𝖔𝖋-𝖙𝖍𝖊𝖒␤»
17:02 gfldex m: my @row = 1; my ($a, $b, $c) = @row; dd $a, $b, $c; for @row -> $a, $b, $c {};
17:02 camelia rakudo-moar 392d21: OUTPUT«Int $a = 1␤Any $b = Any␤Any $c = Any␤Too few positionals passed; expected 3 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
17:02 gfldex seatek: not the same thing ^^^
17:02 domidumont joined #perl6
17:02 hankache joined #perl6
17:03 hankache good evening #perl6
17:03 hackedNODE m: -> $tod { "good $tod!".say }(<evening morning afternoon>.all)
17:03 camelia rakudo-moar 392d21: OUTPUT«good all("evening", "morning", "afternoon")!␤»
17:04 hackedNODE bah
17:04 hackedNODE blocks don't thread?
17:04 hackedNODE m: sub ($tod) { "good $tod!".say }(<evening morning afternoon>.all)
17:04 camelia rakudo-moar 392d21: OUTPUT«good evening!␤good morning!␤good afternoon!␤»
17:04 hankache :)
17:05 hackedNODE m: -> Any $tod { "good $tod!".say }(<evening morning afternoon>.all)
17:05 camelia rakudo-moar 392d21: OUTPUT«good evening!␤good morning!␤good afternoon!␤»
17:05 hackedNODE \o/
17:05 seatek m: my @row = 1, 2, 3; my ($a, $b, $c) = @row ; say "$a $b $c";
17:05 camelia rakudo-moar 392d21: OUTPUT«1 2 3␤»
17:05 seatek m: my @row = 1, 2, 3; for @row -> $a, $b, $c {} ; say "$a $b $c";
17:05 camelia rakudo-moar 392d21: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3 2, 3; for @row -> $a, $b, $c {} ; say "7⏏5$a $b $c";␤»
17:06 hackedNODE seatek: the block of the for loop does arity and type checks for you, while () doesn't
17:07 seatek hackedNODE, yeah - i didn't need any checking... it was just that the old and traditional way that I've used a million times had fallen out of my head somehow ;)
17:08 seatek I've been spending so much time play on this I've gone loopy
17:10 vike joined #perl6
17:12 [Coke] "old traditional" == perl 5?
17:13 seatek yeah, well, in at least that 6 is new to me and 5 isn't
17:14 cdg joined #perl6
17:15 seatek I just have to learn new bad habits in Perl 6
17:18 TEttinger joined #perl6
17:19 psch i think that's part of the users mission currently, to figure out bad habits
17:19 psch as in, we don't really have lots of Best Practices yet
17:20 psch although maybe that's started and i've been burying myself too deep in the compiler :)
17:20 seatek I do find it interesting. Like today I was wondering, should I do @row[0] or @row.head
17:21 seatek my guess is [0] would be much faster
17:21 hackedNODE Well, they do different things, so you'd do the one that gives you the right thing :)
17:22 hackedNODE m: my @a = ^10; dd @a.head; dd @a[0]
17:22 camelia rakudo-moar 392d21: OUTPUT«Int @a = 0␤Int @a = 0␤»
17:22 hackedNODE bah
17:22 hackedNODE m: my @a = ^10; dd @a.head
17:22 camelia rakudo-moar 392d21: OUTPUT«Int @a = 0␤»
17:22 hackedNODE That gives me (0,).Seq on 2016.08.1-143-gc9b18c6
17:23 RabidGravy itym .first
17:23 RabidGravy but they are almost identical in speed
17:23 seatek oh so it's not returning the values but a list
17:23 RabidGravy [jonathan@cannibal ~]$ time perl6 -e 'my @a = <a b c>;  say @a[0]'
17:23 RabidGravy a
17:23 RabidGravy real0m0.449s
17:23 RabidGravy user0m0.377s
17:23 RabidGravy sys0m0.071s
17:23 RabidGravy [jonathan@cannibal ~]$ time perl6 -e 'my @a = <a b c>;  say @a.first'
17:23 RabidGravy a
17:23 RabidGravy real0m0.446s
17:23 RabidGravy user0m0.379s
17:23 RabidGravy sys0m0.065s
17:23 hackedNODE CCCombo breaker!
17:24 perlpilot m: my @a = 5..10; dd @a.head; dd @a[0]; dd @a.first;  # hmm
17:24 camelia rakudo-moar 392d21: OUTPUT«Int @a = 5␤Int @a = 5␤5␤»
17:24 hackedNODE seatek: they're supposed to, but I suspect recent changes broke something
17:24 hackedNODE And our bisect bots are ded :(
17:24 hackedNODE m: my @a = ^10; dd @a.head: 5
17:24 camelia rakudo-moar 392d21: OUTPUT«(0, 1, 2, 3, 4).Seq␤»
17:24 hackedNODE m: my @a = ^10; dd @a.head: 2
17:24 camelia rakudo-moar 392d21: OUTPUT«(0, 1).Seq␤»
17:24 hackedNODE m: my @a = ^10; dd @a.head: 1
17:24 camelia rakudo-moar 392d21: OUTPUT«(0,).Seq␤»
17:24 hackedNODE m: my @a = ^10; dd @a.head
17:24 camelia rakudo-moar 392d21: OUTPUT«Int @a = 0␤»
17:24 hackedNODE Interesting
17:25 hackedNODE m: [], 'head', \()
17:25 camelia rakudo-moar 392d21: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "head" in sink context (lines 1, 1)␤»
17:25 hackedNODE s: [], 'head', \()
17:25 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/blob/c6c0​e69/src/core/Any-iterable-methods.pm#L1886
17:25 hackedNODE Ah, OK. It was made that way on purpose.
17:26 hackedNODE seatek: I guess in this case, it's TMTOWTDI. I don't think there's any noticable speed difference
17:27 hackedNODE s: &postcircumfix:<[ ]>, \([], 0)
17:27 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/blob​/c6c0e69/src/core/array_slice.pm#L122
17:27 psch m: ^5 .head(0..$_).sum.say for ^5 # great way to write '[\+] ^5' innit
17:27 camelia rakudo-moar 392d21: OUTPUT«0␤1␤3␤6␤10␤»
17:28 hackedNODE s: [], 'AT-POS', \(0)
17:28 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/b​lob/c6c0e69/src/core/Array.pm#L558
17:28 seatek it's weird that @a.first can be as fast as @a[0] -- especially when you can use smartmatch in first
17:28 psch seatek: well, MMD
17:29 hackedNODE seatek: @a[0] is just a sub call that calls a method (the above two links from SourceBaby are the source)
17:29 psch m: [Any, 1, 2].first.say
17:29 camelia rakudo-moar 392d21: OUTPUT«(Any)␤»
17:29 seatek everything's an object -- so intuitive notions of what might be more optimal aren't necessarily right
17:30 perlpilot seatek: the smartmatching first is a different code path because of multi dispatch
17:30 hackedNODE seatek: Also, not everything is yet optimal :)
17:30 perlpilot seatek: so, it's not weird at all
17:30 seatek got it ;)
17:30 psch m: say Array.can('first')[0].candidates>>.signature
17:30 camelia rakudo-moar 392d21: OUTPUT«(($: :$end, *%_) ($: Bool:D $t, *%_) ($: Regex:D $test, :$end, *%a) ($: Callable:D $test, :$end, *%a is copy) ($: Mu $test, :$end, *%a))␤»
17:31 psch (there is only one 'first' in Array.^mro fwiw :P )
17:31 psch seatek: so yeah, we know from the (lack of) arguments whether we call to smartmatch or not
17:32 psch s/call/have/
17:32 psch perlpilot++ # said the same thing too
17:33 wamba joined #perl6
17:34 hackedNODE m: ^1e300 .sum.say # another great MMD example :)
17:34 camelia rakudo-moar c6c0e6: OUTPUT«50000000000000005250476025520442162707​939330935502781693234513281591950553570922944​427687902410556295450231453069039107857443450​701531851344390507621368887501794254190804127​540713156857517717263947454872670975123538368​16964499664042956479406857844701441222…»
17:34 perlpilot btw, I just rand 10_000_000 calls to @a.head, @a.first and @a[0]  (because, why not?) and it seems that first took 49s, head 47s, and @a[0] 21s   So ... if you're really into micro optimization and need the first item of an array, use the normal indexing method   :-)
17:35 El_Che lizmat: on what rekudo version did you add the json error output? Talking upstream about the vim syntax support for perl 6 (to integrate the changes from my plugin, now regex based)
17:35 psch perlpilot: what about calling AT-POS directly?
17:35 seatek perlpilot, you've brought order back to my little universe
17:35 seatek perlpilot++
17:35 hackedNODE El_Che: 2016.09
17:36 hackedNODE El_Che: this's the commit: https://github.com/rakudo/rakudo/commit/​aaf7c3cf573814a7027b514000c7505146f19da6
17:36 seatek psch++
17:36 psch (or heck, why not nqp::atpos(nqp::getattr(nqp::decont(@a), 'Positional', $!storage), $idx) ha ha)
17:36 psch honestly though, don't do that :)
17:36 seatek hackedNODE++
17:36 lizmat El_Che: 23rd of August, so it's probably in 206.09
17:36 seatek thanks guys
17:36 hackedNODE And another addition to the feature shortly after: https://github.com/rakudo/rakudo/commit/​826d438f7a3e1fe09c5b9ac0e370caf82a88931a
17:36 lizmat 2016.09
17:37 El_Che thx, I'll add it to the ticket
17:38 seatek this object-oriented approach, clear at the deepest levels even... has it proven to be good at keeping order, or has it proven to be just as fragile, only in different ways?
17:39 perlpilot psch: AT-POS -> 14s
17:39 perlpilot :-)
17:40 perlpilot seatek: uh ... no?
17:40 El_Che he wants to add perl6 support, but I wonder if it's better to just start with 20016.09 and a new plugin
17:40 hackedNODE 20016? :) Talk about a 100-year language! : D
17:41 hackedNODE I hope I'm still alive to do the release.
17:41 itaipu joined #perl6
17:41 seatek perlpilot, yeah it's pretty much an impossible question
17:41 El_Che hackedNODE: the code I have ofr vim syntax checkingis regex based
17:41 El_Che the new rakudo support json output (lizmat++)
17:42 El_Che so it will less fragile
17:42 perlpilot seatek: Have you read TimToady's waterbed theory of language design?
17:43 El_Che on the other hand, the format is not set on stone
17:43 hackedNODE perlpilot: I haven't whereisit?
17:44 seatek perlpilot, no, I'm sadly mostly just a language *user*
17:44 seatek perlpilot, but i'll look for that for some lunch reading
17:45 harmil_wk Is there a way to construct an anonymous list of pairs where the keys are the keys from an existing hash and the values are aliased to the matching values of the original (not copied)?
17:45 perlpilot There's an early version at http://www.perl.com/pub/2003​/06/25/perl6essentials.html, but I'm sure TimToady has something better elsewhere.
17:45 harmil_wk I could do it with a temporary named hash, but not sure if it's possible without.
17:45 seatek perlpilot, couldn't wait.. ah i see. yes. that's what i've found with everything that's supposed to make everything wonderful
17:47 seatek perlpilot, that must be a... challenging balancing act
17:47 timotimo wow, holy crap, the google pixel is *crazy* expensive in europe compared to the us
17:47 psch harmil_wk: a subset of keys or all the keys?
17:48 harmil_wk psch: all the keys
17:48 psch m: my %h = a => 1, b => 2; %h.pairs.cache.grep(*.key eq 'a')[0].value = 3; say %h.perl
17:48 camelia rakudo-moar c6c0e6: OUTPUT«{:a(3), :b(2)}␤»
17:49 psch harmil_wk: i mean, i might be totally missing the point though :)
17:49 harmil_wk I think so... not sure.
17:49 lizmat .u beer
17:49 yoleaux U+1F37A BEER MUG [So] (🍺)
17:49 yoleaux U+1F37B CLINKING BEER MUGS [So] (🍻)
17:50 harmil_wk I was asking because this seemed to be a bit clunky: https://github.com/rakudo/rakudo/bl​ob/nom/src/Perl6/Grammar.nqp#L1194
17:50 lizmat m: my $a = "🍺"; $a++; say $a
17:50 camelia rakudo-moar c6c0e6: OUTPUT«🍻␤»
17:50 harmil_wk And was wondering if there was a way without the temporary variable to do the same.
17:50 lizmat (demoing at amsterdam pm meeting)
17:50 psch harmil_wk: i don't think you can get it easier than that in nqp, no
17:51 psch (the fact that any perl6-ish solution would have lots more overhead aside)
17:51 harmil_wk Huh. Thanks.
17:53 hackedNODE timotimo: so what does it cost?
17:54 hackedNODE Looks highly unoriginal in both name and design.
17:54 timotimo the fingerprint reader on the back seems like an orinigal thing
17:54 timotimo not that i like a fingerprint reader at all
17:55 hackedNODE Exactly lol.
17:55 hackedNODE $1,179 (CAD).... fuck that lol
17:55 timotimo 869 euros if you want 128gb storage, 759 euros otherwise
17:56 timotimo 759 euros equals 850 dollars
17:56 psch only on the stock market
17:56 psch for consumer goods it's always different
17:56 mempko joined #perl6
17:56 psch australia suffers worst for that i guess
17:56 timotimo "Starting at $649 in the US"
17:58 hackedNODE My 2-year old $700CAD Note 4 has better specs across the board, if you ignore the extra gig of RAM. Does google plan to compete with Apple under the "we have a phone jack" banner? XD
17:59 masak so... the .WHERE of an object can change due to GC moves, yes?
17:59 hackedNODE yes
17:59 masak what do I use that doesn't change? :)
17:59 hackedNODE .WHICH?
17:59 hackedNODE I guess for what is a fair question :)
18:00 * perlpilot just wrote some P5 like:  $a = $b->thing if defined $b;  only $a and $b were much longer.
18:00 perlpilot Would have been so much simpler with P6
18:00 masak debug output; need to trace some pretty hairy lexical lookup in 007
18:01 lizmat masak: .WHICH contains the non-changing objectid
18:01 lizmat masak: if you wanna go nqp, you can use nqp::objectid
18:01 hackedNODE m: my $x = 4; my $y = 4; my $x2 = 1000; my $y2 = 1000; dd [$x.WHICH, $y.WHICH, $x2.WHICH, $y2.WHICH];
18:01 camelia rakudo-moar c6c0e6: OUTPUT«[ObjAt.new("Int|4"), ObjAt.new("Int|4"), ObjAt.new("Int|1000"), ObjAt.new("Int|1000")]␤»
18:01 masak ok, great
18:01 seatek perlpilot, that's a great piece you linked me to - thank you.
18:05 perlpilot seatek: you're welcome
18:05 seatek A clearly defined set of rules will never match the power of a feature that "just seems right."
18:05 seatek That's the waterbed in large part it seems to me
18:06 seatek yet objects require strict rules or else troublesome dependencies start to happen
18:06 seatek that's the amazing bit to me
18:09 seatek it must be some pretty wild design at the "atomic" level. Hmm. This VM is kinda making sense now.
18:09 mst perlpilot: show me the code and let's see if you confused something :)
18:09 masak "waterbed theory" is also mentioned once in A05
18:09 psch seatek: well, it mostly starts with knowhow (scnr)
18:10 psch m: say Any.HOW.HOW.HOW.HOW.^name # ha ha
18:10 camelia rakudo-moar c6c0e6: OUTPUT«KnowHOW␤»
18:11 psch seatek: well, the object model at least... :)
18:11 seatek psch, :) :)
18:13 hackedNODE mst: the if defined for method calls is pretty common in Perl 5 tho. While Perl 6 has a safe call operator
18:14 hackedNODE m: dd Mu.?grep: 42;
18:14 camelia rakudo-moar c6c0e6: OUTPUT«Nil␤»
18:14 mst hackedNODE: the if defined for method calls is common if you don't know perl5 well enough to avoid it, yes
18:14 hackedNODE :(
18:14 mst hackedNODE: however Safe::Isa largely eliminates the need, and there's alternatives for other things
18:15 mst as usual, many criticisms of perl5 are due to insufficient knowledge of perl5
18:15 mst though I totally agree perl6 makes it easier to find the right thing
18:15 hackedNODE Yes, there's module for everything. Until that module is written by a crazy person and another module de jour takes place.
18:16 masak mst: I have an honest question about Perl 5 and insufficient knowledge. if I suspect there are a lot of more-or-less well-known CPAN modules I ought to know about (so I don't re-invent the wheel or use a lesser Perl 5 than I should), where should I start looking to learn more?
18:17 hackedNODE masak: Task::Kensho
18:17 mst which we should do a round of updates to shortly
18:17 mst also the mstpan
18:17 masak ooh
18:17 masak I knew about Task::Kensho, but not about mstpan
18:18 * hackedNODE looks at Safe::Isa
18:18 Jonis joined #perl6
18:19 hackedNODE It's hard to convince me that `use Safe::Isa; ...->$_call_if_object` is on equal footing with just `.?`
18:20 mst I wasn't trying to convince you of that
18:21 * masak .oO( don't you come here trying to tell me what you were or were not trying to tell me! ) :P
18:24 AlexDaniel joined #perl6
18:26 dogbert17 o/ #perl6
18:26 hackedNODE \o
18:26 masak yo dogbert17
18:26 dogbert17 have a possible mystery for you
18:26 psch ooh
18:26 psch dogbert17++
18:27 masak the butler! the butler did it!
18:27 hackedNODE :)
18:27 dogbert17 m: my int $i = 2482111348; say $i; $i = $i div 2; say $i #what's happening here?
18:27 camelia rakudo-moar c6c0e6: OUTPUT«2482111348␤-906427974␤»
18:27 psch no, the gardener with the aerosol can!
18:27 masak dogbert17: what, don't you like negative numbers? :P
18:27 psch m: say 2482111348.base(2)
18:27 camelia rakudo-moar c6c0e6: OUTPUT«10010011111100100000001101110100␤»
18:28 dogbert17 masak: they have their charm :-)
18:28 psch m: say 2482111348.base(2).comb(/\d/).chars
18:28 camelia rakudo-moar c6c0e6: OUTPUT«63␤»
18:28 psch that is mysterious
18:28 dogbert17 yay
18:28 psch m: say -906427974.base(2).comb(/\d/).chars
18:28 camelia rakudo-moar c6c0e6: OUTPUT«-59␤»
18:28 perlpilot dogbert17: you could have saved some characters and just said "bug" instead of "mystery"  :)
18:28 masak m: say 2482111348.base(2).chars
18:28 camelia rakudo-moar c6c0e6: OUTPUT«32␤»
18:28 psch masak++ # i'm being silly
18:29 psch shoulda gone .elems, in hindsight
18:29 dogbert17 so an int is 32 bits then?
18:29 masak m: say (-906427974).base(2).chars
18:29 camelia rakudo-moar c6c0e6: OUTPUT«31␤»
18:29 psch the speculated answer is "it's platform dependent"
18:29 psch not sure if we're actually going with that for roast though
18:29 masak conceptually, they're arbitrary-precision
18:29 psch masak: int is?
18:29 psch masak: i thought that was Int
18:29 masak oh, wait
18:29 Xliff say 8675309.base(3)
18:30 Xliff m: say 8675309.base(3)
18:30 camelia rakudo-moar c6c0e6: OUTPUT«121022202021202␤»
18:30 masak didn't see the lowercase `int` there :)
18:30 hackedNODE m: my int $i = 2482111348; say $i / 2;
18:30 camelia rakudo-moar c6c0e6: OUTPUT«1241055674␤»
18:30 dogbert17 m: my int64 $i = 2482111348; say $i; $i = $i div 2; say $i # a larger int I think
18:30 camelia rakudo-moar c6c0e6: OUTPUT«2482111348␤-906427974␤»
18:30 hackedNODE s: &infix:<div>, \(my int $i = 2482111348, 2)
18:30 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/​blob/c6c0e69/src/core/Int.pm#L264
18:31 psch m: my uint $i = 2482111348; say $i; $i = $i div 2; say $i
18:31 camelia rakudo-moar c6c0e6: OUTPUT«2482111348␤-906427974␤»
18:31 psch j: my uint $i = 2482111348; say $i; $i = $i div 2; say $i
18:31 camelia rakudo-jvm 2a1605: OUTPUT«2482111348␤1241055674␤»
18:31 psch haha! jvm backend wins again!
18:31 hackedNODE m: my int $a = 2482111348; my $b = 2; nqp::div_I(nqp::decont($a), nqp::decont($b), Int)
18:31 camelia rakudo-moar c6c0e6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Could not find nqp::decont, did you forget 'use nqp;' ?␤at <tmp>:1␤------> 8; my $b = 2; nqp::div_I(nqp::decont($a)7⏏5, nqp::decont($b), Int)␤»
18:31 hackedNODE m: use MONKEY-GUTS; my int $a = 2482111348; my $b = 2; dd nqp::div_I(nqp::decont($a), nqp::decont($b), Int)
18:31 camelia rakudo-moar c6c0e6: OUTPUT«1241055674␤»
18:32 masak "XML::Simple claims to round trip ... but only in the sense that if you jump off a tall building with an overly long bungee cord, your mangled remains will probably end up somewhere back near the top." -- mst++ :)
18:32 hackedNODE m: use MONKEY-GUTS; my int $a = 2482111348; my $b = 2; dd nqp::div_i($a, $b)
18:32 camelia rakudo-moar c6c0e6: OUTPUT«-906427974␤»
18:32 hackedNODE m: use MONKEY-GUTS; my int $a = 2482111348; my $b = 2; dd nqp::div_i($a, nqp::decont($b))
18:32 camelia rakudo-moar c6c0e6: OUTPUT«-906427974␤»
18:33 hackedNODE Are you tired of my spam, or should I continue? :D
18:33 dogbert17 I'm not tired :)
18:33 psch it's not kinda "int64 isn't, also signedness" i think? :S
18:33 * masak still thinks the butler did it
18:34 * psch starts to agree
18:34 Xliff query camelia
18:34 psch although the gardener might be more involved with native(ly growing plants ha ha)
18:34 hackedNODE It's kinda weird that the candidate SourceBaby points to actually works.
18:34 hackedNODE And the broken one isn't supposed to fit
18:35 Xliff Well, looks like someone beat me to CArray.STORE. It has taken me forever to get around to it.
18:35 psch m: sub f(Int $) { "Int" }; sub f(int $) { "int" }; my int $x = 0; say f $x
18:35 camelia rakudo-moar c6c0e6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Redeclaration of routine 'f' (did you mean to declare a multi-sub?)␤at <tmp>:1␤------> 3Int $) { "Int" }; sub f(int $) { "int" }7⏏5; my int $x = 0; say f $x␤    expecting any of:␤        horizo…»
18:35 lucasb_ what? the MMD for int vs Int? I don't think they are always reliable
18:35 psch m: multi f(Int $) { "Int" }; multi f(int $) { "int" }; my int $x = 0; say f $x
18:35 camelia rakudo-moar c6c0e6: OUTPUT«int␤»
18:35 Xliff m: use NativeCall; my @a = CArray[int32].new; @a = Bool.roll(100); say @a.elems
18:35 psch there was a bug there once but it was also fixed
18:35 camelia rakudo-moar c6c0e6: OUTPUT«100␤»
18:35 psch maybe not quite
18:36 Xliff Or maybe not.
18:36 hackedNODE lucasb_: what does that mean? What's the point of unreliability?
18:36 lucasb_ m: multi f(Int) {'I'}; multi f(int) {'i'}; say f(1)
18:36 camelia rakudo-moar c6c0e6: OUTPUT«i␤»
18:36 lucasb_ m: multi f(Int) {'I'}; multi f(int) {1+2}; say f(1)
18:36 camelia rakudo-moar c6c0e6: OUTPUT«I␤»
18:36 psch m: multi f(Int $) { "Int" }; multi f(int $) { "int" }; my int $x = 0; say f $x
18:36 camelia rakudo-moar c6c0e6: OUTPUT«int␤»
18:36 psch ah nvm
18:37 seatek All I know is that my first day playing with P6 recently, I threw away ever using "int" because it was doing crazy stuff and used "Int" instead
18:37 lucasb_ just changed the inside expression and the dispatch stopped matching
18:37 hackedNODE lucasb_: that's an optimizer bug
18:38 hackedNODE If you turn it off it works fine
18:38 lucasb_ ah, I didn't know that. thanks hackedNODE++
18:38 dogbert17 hackedNODE++
18:38 hackedNODE Would be nice if camelia had an option to run with optimizer off
18:38 * psch dimly remembers jnthn++ fixing something along those lines back somewhen...
18:38 hackedNODE ...by which I mean I'm too lazy to do it myself and hoping someone else will do it for me :P
18:39 psch i wonder if the EvalServer actually supports that
18:39 psch i think it should, but i'm not sure
18:39 timotimo it ought to
18:39 timotimo if not, it should be easy to implement
18:39 hackedNODE Ohooo
18:39 hackedNODE dogbert17: yours is also an optimizer bug
18:40 hackedNODE Optimzier bugs for everyone \o/
18:40 psch yeah we got a lot of those recently don't we
18:40 rgrinberg joined #perl6
18:40 hackedNODE That's good. It means they're migrating further down the end :)
18:40 dogbert17 interesting, I used int to speed up a problem I discussed with timotimo yesterday when I noticed that the results defered between Int and int
18:41 dogbert17 s/defered/differed/
18:41 dogbert17 the int version was quite a bit faster but alas incorrect
18:41 timotimo damn
18:42 dogbert17 timotimo: optimizer bug according to hackedNODE
18:42 labster joined #perl6
18:43 timotimo right
18:43 hackedNODE Yeah, and I think what lucasb_ showed is the same bug. The int candidate gets called when an Int is given.
18:43 hackedNODE So the int, int div candidate gets called.
18:43 hackedNODE m: my int $a = 2482111348; my int $b = 2; say $a div $b;
18:43 camelia rakudo-moar c6c0e6: OUTPUT«-906427974␤»
18:43 timotimo that should only happen if the numbers are in range, though
18:43 hackedNODE Why does that ^ give a negative numbers though?
18:43 timotimo o_O
18:43 timotimo m: say 2482111348.base(16)
18:43 camelia rakudo-moar c6c0e6: OUTPUT«93F20374␤»
18:44 hackedNODE m: use MONKEY-GUTS; my int $a = 2482111348; my int $b = 2; say nqp::div_i($a,$b);
18:44 camelia rakudo-moar c6c0e6: OUTPUT«-906427974␤»
18:44 timotimo m: say (-906427974).base(16)
18:44 camelia rakudo-moar c6c0e6: OUTPUT«-3606FE46␤»
18:45 * masak fixes a pretty hairy bug by switching on MONKEY-SEE-NO-EVAL and using EVAL
18:45 hackedNODE m: "say 'Stop absuing the monkeys!'".EVAL
18:45 camelia rakudo-moar c6c0e6: OUTPUT«Stop absuing the monkeys!␤»
18:45 perlpilot "fixes"?  or "sweeps under the rug"?  ;)
18:45 masak by the way, I still think the error message for EVAL is a tad too hysterical. three exclamation marks. "a very dangerous function!!!"
18:46 masak perlpilot: yes, there is technical debt in there. yes, I will eventually get around to doing it differently :P
18:46 hackedNODE :D
18:46 masak but this is a local, short-term improvement (that just happens to involve EVAL)
18:46 dogbert17 hackedNODE: should I RT this?
18:47 hackedNODE dogbert17: yes, please.
18:47 perlpilot Hey, I won't judge.  I'm just trying to make sure about your grasp of reality   :)
18:47 dogbert17 ok
18:48 perlpilot dogbert17: did you look to see if there was already an RT ticket for it?  You might do a quick search first, but when in doubt, rakudobug it.
18:49 dogbert17 perlpilot: I'll take a look
18:51 dogbert17 perlpilot: RT #128655 looks a bit similar
18:51 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=128655
18:52 masak perlpilot: https://github.com/masak/007/commit/a3​9a4418d05746b01d9c692a233df31b5162459e
18:53 lucasb_ yes, looks the ticket looks related
18:53 lucasb_ idk why the int/Int distinction interacts with multi's
18:53 lucasb_ m: sub f(int) {1+2}; say f(1)
18:53 camelia rakudo-moar c6c0e6: OUTPUT«3␤»
18:53 lucasb_ m: multi f(int) {1+2}; say f(1)
18:53 camelia rakudo-moar c6c0e6: OUTPUT«Cannot resolve caller f(Int); none of these signatures match:␤    (int)␤  in block <unit> at <tmp> line 1␤␤»
18:54 lucasb_ also... for anyone how likes to write the docs... I'd like to suggest the inclusion of a question in the FAQ
18:54 hackedNODE dogbert17: yeah, seems to be the same thing. Maybe just comment on it, mentioning this happens with any sub with int/Int multies, not just bitwise ops, so the quickfix described in the ticket isn't applicable.
18:54 lucasb_ "A literal integer like 1234 is an 'int' or an 'Int'?"
18:55 awwaiid m: 123.WHAT.say
18:55 camelia rakudo-moar c6c0e6: OUTPUT«(Int)␤»
18:55 dogbert17 hackedNODE: and how do I comment on that bug?
18:55 awwaiid ah, for faq
18:55 lucasb_ I said FAQ because I myself already asked this before... but forgot the answer :D
18:55 dogbert17 do I mention the RT # in the mail subject?
18:56 lucasb_ the answer probably is "It depends"
18:56 awwaiid hehe
18:56 hackedNODE dogbert17: do you have the "Reply Comment" buttons on right of page?
18:56 dogbert17 too easy :)
18:58 dogbert17 pressing "Reply Comment" gives "This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure. For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org "
18:58 hackedNODE dogbert17: did you log in?
18:58 dogbert17 with what credentials?
18:58 hackedNODE dogbert17: if you type up what you wanted to comment with I can post it on your behalf
18:59 hackedNODE dogbert17: with your RT account.
18:59 hackedNODE I guess you don't have it? :D
18:59 dogbert17 :D
18:59 hackedNODE And I think even if you had one, commenting on just any ticket requires elevated privileges
19:00 dogbert17 I'll whip something up and send you a gist
19:00 girafe joined #perl6
19:01 perlpilot masak: rather than EVAL, could you wrap that in a sub {} which you immediately evaluate?
19:01 masak perlpilot: no, I tried that.
19:02 masak perlpilot: the problem is that `class` is not a closure. it doesn't close over its environment.
19:02 spider-mario joined #perl6
19:02 masak it evaluates at compile time, and after that it's just not very fun at parties.
19:03 perlpilot oh, I see.   I was thinking the sub {} would make a closure for you, but by then it's too late
19:03 masak indeed
19:04 * perlpilot wonders if you can parameterize anonymous classes
19:04 masak no, only roles
19:04 masak and I tried that too
19:04 perlpilot heh
19:04 masak but even that happens too early
19:04 masak or at least I couldn't find the right invocation to make it happen late enough
19:05 sjoshi joined #perl6
19:05 masak but EVAL is a way to make things happen late
19:07 masak just as BEGIN makes things happen early
19:21 dalek joined #perl6
19:22 [Coke] m: use MONKEY; EVAL 'use MONKEY; ' ~ ('EVAL ' x 2000) ~ 3
19:22 camelia rakudo-moar c6c0e6: ( no output )
19:23 [Coke] m: use MONKEY; say EVAL 'use MONKEY; ' ~ ('EVAL ' x 2000) ~ 3 # not as late as possible, but pretty late
19:23 camelia rakudo-moar c6c0e6: OUTPUT«3␤»
19:24 * masak boggles
19:25 masak wait, you have to `use MONKEY;` inside the EVAL string, too?
19:25 masak surely by that time you're already pretty monkied?
19:25 * masak .oO( this is a simian compunit )
19:25 [Coke] yup, required.
19:25 mst monkey C, monkeys du
19:26 [Coke] monkey C, monkey Mu
19:28 gfldex m: my int $i; dd $i; $i = Nil;
19:28 camelia rakudo-moar c6c0e6: OUTPUT«0␤Cannot unbox a type object␤  in block <unit> at <tmp> line 1␤␤»
19:29 gfldex m: my int $i; dd $i; BEGIN say 'bird'; $i = Nil;
19:29 camelia rakudo-moar c6c0e6: OUTPUT«bird␤0␤Cannot unbox a type object␤  in block <unit> at <tmp> line 1␤␤»
19:29 gfldex ENODOC++
19:33 dalek doc: a6c627c | gfldex++ | doc/Type/Nil.pod6:
19:33 dalek doc: explain native type and Nil
19:33 dalek doc: review: https://github.com/perl6/doc/commit/a6c627cf40
19:33 gfldex ENODOC--
19:33 gfldex m: my int $i; $i = Nil;
19:33 camelia rakudo-moar d8309d: OUTPUT«Cannot unbox a type object␤  in block <unit> at <tmp> line 1␤␤»
19:33 gfldex that's LTA. If there is a Nil spillage somewhere, that error message can be fairly confusing.
19:38 firefish5000 joined #perl6
19:40 [Coke] what's a better error message?
19:42 psch m: my int $x is default(0) = Nil; say $x
19:42 camelia rakudo-moar d8309d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use trait 'is default' on a native.␤at <tmp>:1␤------> 3my int $x is default(0)7⏏5 = Nil; say $x␤    expecting any of:␤        constraint␤»
19:42 timotimo it could tell that it's a Nil there
19:42 timotimo via the debugname
19:42 labster joined #perl6
19:42 psch well, native types cannot have defaults nor "no value", so assigning Nil to them is meaningless
19:43 psch not sure how that translates to an error message though
19:43 timotimo working on it
19:43 _slade_ joined #perl6
19:44 firefish5000 Good day! Its been a while since I have fixed my perl6... just to be sure, there is no no longer a 'for' method for lists/arrays correct?
19:45 psch m: Array.can('for').say
19:45 camelia rakudo-moar d8309d: OUTPUT«()␤»
19:45 psch m: Positional.can('for').say
19:45 camelia rakudo-moar d8309d: OUTPUT«()␤»
19:45 moritz firefish5000: no, it's spelled 'map' again :/
19:45 timotimo just pushed a patch to moarvm that makes the error message more informative
19:46 hackedNODE \o/
19:46 psch j: my int $i; $i = Nil;
19:46 camelia rakudo-jvm 2a1605: OUTPUT«Cannot unbox a type object␤  in block <unit> at <tmp> line 1␤␤»
19:48 firefish5000 Ok, thanks moritz, all of my old code had '.for', I love dot notation. Looks like 's/\.for/\.map' works well!
19:49 firefish5000 Unfortunatly my code is still horribly buggy, I finaly got it to compile but it does the exact opisit of what its suppose to do....
19:50 lucasb_ drop the R metaoperator :)
19:50 timotimo probably needs a bit more explicit flattening
19:52 firefish5000 I am not sure if that was aimed at me, but it does seem to need more explicit flattening, bu single value returned is now a 4 levels deep array
19:52 * [Coke] suspects this code is over a year old.
19:53 lucasb_ what was the purpose of the .for method? to have a .map that didn't accumulate it's result?
19:53 timotimo yeah, definitely pre-GLR
19:54 firefish5000 lol, 1.5-3 years I think. Supposedly I last worked on it in Febuary of last year
19:54 moritz lucasb_: it as a .map with some (non-)flattening behavior that .map was going to lose
19:54 moritz *was
19:55 mcmillhj joined #perl6
19:55 lucasb_ moritz: ah, ok. thanks
20:04 skids nativetypes do "have a default" in that they have a hard-coded one, just cannot have the "default" trait applied.  Whether assigning Nil to them should be legal... and whether they should have a .default method... I dunno.
20:04 skids m: my int32 $a; $a.say;
20:04 camelia rakudo-moar d8309d: OUTPUT«0␤»
20:05 mcmillhj joined #perl6
20:05 lucasb_ m: my num $x; say $x.perl
20:05 camelia rakudo-moar d8309d: OUTPUT«NaN␤»
20:05 lucasb_ interesting. I was expecting 0.0 as the default
20:15 andrzejku joined #perl6
20:17 andrzejku hello my friends :)
20:18 mohae joined #perl6
20:26 nyarmith joined #perl6
20:28 [Coke] o/
20:29 gfldex can zef setup a new CompUnit::Repository ?
20:39 gfldex it can not
20:40 gfldex how does one create a CompUnit::Repository?
20:44 gfldex zef --install-to=home insall Any::Module::You::Like # that will install a repro in $HOME/.perl6
20:44 gfldex maybe I should first read the code and then not ask questions? :->
20:48 mcmillhj joined #perl6
20:55 labster joined #perl6
20:59 Dunearhp joined #perl6
21:08 seatek m: sub del(Int :$id where {$id > 0}) { $id }; say del(id => 2);
21:08 camelia rakudo-moar d8309d: OUTPUT«2␤»
21:09 seatek m: sub del(Int :$id? where {$id > 0}) { $id }; say del(id => 2);
21:09 camelia rakudo-moar d8309d: OUTPUT«2␤»
21:09 seatek m: sub del(Int :$id? where {$id > 0}) { $id }; say del();
21:09 camelia rakudo-moar d8309d: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub del at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:09 seatek It must be my sprained brain
21:10 seatek m: sub del(Int :$id? where {$id > 0}) { 0 }; say del();
21:10 camelia rakudo-moar d8309d: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub del at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:10 seatek does using a "where" clause in the signature make a parameter impossible to be optional?
21:11 canopus joined #perl6
21:12 AlexDaniel m: sub del(Int :$id? where {not defined $id or $id > 0}) { 0 }; say del();
21:12 camelia rakudo-moar d8309d: OUTPUT«0␤»
21:13 seatek ok that's weird but i understand - thank you
21:13 AlexDaniel seatek: it is weird indeed
21:13 seatek AlexDaniel++
21:14 AlexDaniel I am not sure if where {} check should be run if the parameter is optional
21:14 seatek i think it absolutely should not
21:14 AlexDaniel seatek: can you create a ticket for that?
21:15 seatek i have never made a ticket here -- would that be for rakudo?
21:16 seatek somebody said earlier than, when in doubt, open for Rakudo.. but I felt pity for Rakudo when I heard that, so I'm a little hesitant ;)
21:17 AlexDaniel seatek: no it's right
21:17 AlexDaniel huggable: bug
21:17 huggable AlexDaniel, nothing found
21:17 AlexDaniel huggable: bug report
21:17 huggable AlexDaniel, nothing found
21:17 gfldex it must be run or you could not check for mutual exclusive parameters
21:17 AlexDaniel huggable: rakudobug
21:17 huggable AlexDaniel, rakudobug@perl.org or use perl6 query on http://rt.perl.org ; see https://github.com/rakudo/rakudo/#reporting-bugs
21:17 cpage__ joined #perl6
21:18 AlexDaniel seatek: this one ↑
21:19 gfldex m: sub f(Int :$a?, Int :$b? where { $a.defined ^^ $b.defined }){}; f(:a(10))
21:19 camelia rakudo-moar d8309d: ( no output )
21:19 gfldex m: sub f(Int :$a?, Int :$b? where { $a.defined ^^ $b.defined }){}; f(:a(10), :b(10))
21:19 camelia rakudo-moar d8309d: OUTPUT«Constraint type check failed for parameter '$b'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:19 seatek gfldex, You saying that you have to run the where clause even on optional parameters?
21:19 gfldex m: sub f(Int :$a?, Int :$b? where { $a.defined ^^ $b.defined or die 'either use :a or :b, but not both'}){}; f(:a(10), :b(10))
21:19 camelia rakudo-moar d8309d: OUTPUT«either use :a or :b, but not both␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:20 gfldex yes
21:20 gfldex or that example would not be possible
21:20 seatek then it isn't an optional parameter
21:20 seatek there's some kind of "pay the devil" in there
21:21 gfldex all named parameters are optional
21:21 AlexDaniel so now you have a constraint on $b that checks both $a and $b
21:22 AlexDaniel which is even weirder
21:22 seatek all named parameters are optional, but when you have a named parameter with a where clause, you have to remember to check again if it's there or not yourself
21:23 gfldex m: sub f(Int $i? where { $_ ~~ Int || $_ > 10 }){}; f
21:23 camelia rakudo-moar d8309d: ( no output )
21:23 seatek so it's optional, but you better make sure if it's there or not
21:23 gfldex a where clause must be able to supersede a type constraint
21:24 gfldex m: sub f(Int $i? where { $_ ~~ Nil || $_ > 10 }){}; f
21:24 camelia rakudo-moar d8309d: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:24 seatek this is that damn waterbed
21:25 gfldex m: sub (|(:$a, :$b) where { $a.defined ^^ $b.defined } ){} # that doesn't work and that's why any where clause has to be executed
21:25 camelia rakudo-moar d8309d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Obsolete use of | or \ with sigil on param (:$a, :$b)␤at <tmp>:1␤------> 3sub (|(:$a, :$b)7⏏5 where { $a.defined ^^ $b.defined } ){} ␤»
21:26 devmikey joined #perl6
21:27 gfldex a where-clause is a guard against false assignment. If no argument is there to bind to, the compiler invents a value for it and it picks Any
21:27 gfldex because Any is the default default
21:28 gfldex so there is always a value to be checked against, what the where-clause does
21:32 seatek I can accept it. But it will require a chocolate break to completely.
21:33 stmuk_ joined #perl6
21:34 seatek Where I'll be pondering the detailed, lesser-used semantics against the common intuitive thinking
21:35 gfldex ENODOC btw
21:37 seatek what's ENODOC?
21:39 dalek doc: c84bbed | gfldex++ | doc/Type/Signature.pod6:
21:39 dalek doc: tell that where clauses are executed on not provided optional arguments
21:39 dalek doc: review: https://github.com/perl6/doc/commit/c84bbed329
21:39 gfldex ERROR NO DOCUMENTATION
21:40 gfldex and since my brain is a sieve with a fairly wide mesh, I tend to fix those to help my future self
21:42 seatek Thank you for that! I'd put giant flashing warning lights there that say, OPTIONAL PARAMETERS ARE NOT OPTIONAL AND WILL RESULT IN A COMPILER ERROR IF YOU USE A WHERE CLAUSE AND DO NOT CHECK IF THAT OPTIONAL PARAMETER IS DEFINED
21:42 seatek it's much clearer to a user
21:43 gfldex but you are writing test for your software don't you? So you can't possibly miss that problem!
21:43 seatek it's not an easy one to find
21:43 seatek there error message is useless
21:43 labster joined #perl6
21:44 seatek Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new
21:44 gfldex imagine you would have to write a book about Perl 6 :->
21:44 seatek oh yeah, I forgot to check if my optional parameter was checked
21:44 gfldex the error message is LTA indeed, feel free to rakudobug
21:47 seatek I hate the where clause now. I'm going to boycott it everywhere. ;)
21:49 gfldex m: subset S of Int where * > 10; sub f(S $i?){}; f;
21:49 camelia rakudo-moar d8309d: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at <tmp> line 1␤␤»
21:49 gfldex that kinda sucks
21:49 gfldex m: subset S of Int where dd *; sub f(S $i?){}; f;
21:49 camelia rakudo-moar d8309d: OUTPUT«*␤*␤Constraint type check failed for parameter '$i'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:49 gfldex m: subset S of Int where { dd $_ }; sub f(S $i?){}; f;
21:49 camelia rakudo-moar d8309d: OUTPUT«Int $topic = Int␤Int $topic = Int␤Constraint type check failed for parameter '$i'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:50 gfldex that should be Nil
21:50 gfldex so there is a bug
21:51 dalek doc: 0f2e64e | (David Warring)++ | META.info:
21:51 dalek doc: add Pod::To::HTML dependency
21:51 dalek doc:
21:51 dalek doc: It's used by ./htmlify.p6
21:51 dalek doc: review: https://github.com/perl6/doc/commit/0f2e64e06a
21:51 bjz joined #perl6
21:52 dwarring joined #perl6
21:52 gfldex well, maybe not
21:53 gfldex m: f(Int $i = Int){ dd $i }; f;
21:53 camelia rakudo-moar d8309d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3f(Int7⏏5 $i = Int){ dd $i }; f;␤    expecting any of:␤        infix␤        infix stopper␤»
21:53 gfldex m: sub f(Int $i = Int){ dd $i }; f;
21:53 camelia rakudo-moar d8309d: OUTPUT«Int␤»
21:54 gfldex that's what a optional parameter actually is
22:00 gfldex m: sub f(Int $i = Nil){ dd $i }; f;
22:00 camelia rakudo-moar d8309d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Default value 'Nil' will never bind to a parameter of type Int␤at <tmp>:1␤------> 3sub f(Int $i = Nil7⏏5){ dd $i }; f;␤    expecting any of:␤        constraint␤»
22:01 masak 'night, #perl6
22:13 TimToady joined #perl6
22:14 bjz joined #perl6
22:17 seatek gfldex, i just went for a walk with an english muffin. you're right i think. the ability to check parameters, even optional ones, in the where clause, outweighs the clarity of "optional parameters" being truly, completely optional when where clauses are there. you're absolutely right, and i'm glad it's that way. but it will be point of pain for many i am sure.
22:19 gfldex i still think the topic of a where clause on a not given optional parameter should be Nil and not the type object. That way you got a chance to make the distinction within the where clause.
22:20 gfldex .tell TimToady please have a look at the following (and above) https://irclog.perlgeek.de/​perl6/2016-10-04#i_13336963
22:20 yoleaux gfldex: I'll pass your message to TimToady.
22:20 kurahaupo joined #perl6
22:22 gfldex a quick grep in roast goes not find a test for optional parameters with where clauses. So that might be a blind spot of Perl 6.
22:23 seatek gfldex, i like the idea of Nil better too, but i don't have enough experience in these matters to know if a type might be better -- but i can't image why it would be.. ??
22:23 wtw_ joined #perl6
22:24 seatek gfldex, it's a very frustrating blind spot because it's very unintuitive unless you know about it ahead of time
22:24 gfldex that's why I doced it :)
22:26 gfldex i'm trying to install all modules from the eco system. It took zef about 30min to decide in what order to install those modules.
22:26 TimToady m: subset S of Int where { not .DEFINITE or $_ > 5 }; sub f(S $i?){}; f;
22:26 camelia rakudo-moar d8309d: ( no output )
22:26 yoleaux 22:20Z <gfldex> TimToady: please have a look at the following (and above) https://irclog.perlgeek.de/​perl6/2016-10-04#i_13336963
22:27 labster joined #perl6
22:27 TimToady m: subset S of Int where { not .DEFINITE or $_ > 5 }; sub f(S $i?){}; f 10;
22:27 camelia rakudo-moar d8309d: ( no output )
22:27 TimToady m: subset S of Int where { not .DEFINITE or $_ > 5 }; sub f(S $i?){}; f 0;
22:27 camelia rakudo-moar d8309d: OUTPUT«Constraint type check failed for parameter '$i'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:27 TimToady that's how you have to write it currently
22:28 gfldex TimToady: is .DEFINITE official?
22:28 TimToady that's what :D means
22:29 TimToady and that's pretty official...
22:29 TimToady m: say Failure.new.defined
22:29 camelia rakudo-moar d8309d: OUTPUT«False␤»
22:29 TimToady m: say Failure.new.DEFINITE
22:29 camelia rakudo-moar d8309d: OUTPUT«True␤»
22:31 gfldex m: class C { method DEFINITE { False } }; sub f($a:D){}; f C.new;
22:31 camelia rakudo-moar d8309d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'D' in parameter declaration.␤at <tmp>:1␤------> 3 method DEFINITE { False } }; sub f($a:D7⏏5){}; f C.new;␤»
22:31 TimToady m: subset S of Int where { not .DEFINITE or $_ > 5 }; sub f(S $i = 10){}; f;
22:31 camelia rakudo-moar d8309d: ( no output )
22:31 gfldex m: class C { method DEFINITE { False } }; sub f(Any:D $a){}; f C.new;
22:31 camelia rakudo-moar d8309d: ( no output )
22:32 TimToady .DEFINITE is really an operator like .WHAT
22:33 TimToady m: class C { method DEFINITE { True } }; sub f(Any:D $a){}; f C;
22:33 camelia rakudo-moar d8309d: OUTPUT«Parameter '$a' requires an instance of type Any, but a type object was passed.  Did you forget a .new?␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:33 TimToady so you can't override it like a method
22:34 TimToady iirc it actually means nqp::isconcrete or so
22:35 gfldex i wonder if it should warn when you try to overload those pseudo-methods
22:35 Praise joined #perl6
22:35 timotimo i think we have a p6concrete or something
22:36 TimToady nah, for p6 you just call the .defined method
22:36 skids joined #perl6
22:37 gfldex m: class C { method WHAT { 'wrong' } }; C.new.WHAT.say;
22:37 camelia rakudo-moar d8309d: OUTPUT«(C)␤»
22:37 TimToady same deal there, yeah
22:38 dalek doc: a780b0f | gfldex++ | doc/Language/mop.pod6:
22:38 dalek doc: WHAT and DEFINITE are pseudo-methods
22:38 dalek doc: review: https://github.com/perl6/doc/commit/a780b0f183
22:38 gfldex any complains can be thwarted with RTFM :)
22:39 TimToady thing is, "where" currently means "here's an invariant that must hold in this routine"
22:40 TimToady and we uphold type invariants on optional params by supplying a type object
22:40 cdg joined #perl6
22:41 TimToady m: sub f(Int $a?){ say $a ~~ Int }; f;
22:41 camelia rakudo-moar d8309d: OUTPUT«True␤»
22:41 gfldex what do you think about providing Nil to the where clause for unspecified optionals?
22:41 TimToady Nil would break that invariant view of things
22:45 TimToady type objects are how we indicate a Maybe type without a value, basically
22:46 nadim_ joined #perl6
22:51 seatek what would you think about calling "optional" parameters, "removeable" parameters instead? that might trigger people to think and look more about it, rather than becoming frustrated. thing is, it's just when where's are attached
22:53 TimToady I don't think using a more obscure word helps here
22:54 TimToady we do allow Nil and Failure to leak out of typed functions, but it seems like a new level of danger to let them leak in
22:56 TimToady m: sub f(Int:D $a where * > 0 = 10){ say $a ~~ Int }; f;
22:56 camelia rakudo-moar d8309d: OUTPUT«True␤»
22:57 TimToady that's the normal way of not breaking an invariant on an optional parameter, and I'm not sure trying to dwim on $a? by breaking the invariant is gonna be all that helpful
22:57 TimToady it's certainly possible we could have better error messages though
22:58 seatek that would go miles
22:58 TimToady course, if you're the first person to run into this, then that says something too :)
22:59 seatek my first thought was, perl is broke! because it's an optional parameter, that obviously isn't being treated like an optional parameter
23:00 TimToady .oO(making invariants vary is hard, let's go shopping)
23:01 seatek i've learned so much about the internals here, listening to you guys go into why it's actually like that from this little thing :)
23:01 seatek ok :)
23:02 TimToady well, we're all still learning, when it comes down to it...
23:03 seatek yeah, i was just talking with someone about specialized knowledge vs generalized, and how one can become unable to see the other so easily
23:03 seatek that's what i've always loved bout the perls, actually, (thanks timtoady :) )
23:04 seatek i trust what you guys are doing
23:04 TimToady the downside of every feature serving multiple purposes is that if you make something dwim for one purpose, it often compromises the other purposes
23:05 seatek that waterbed
23:05 seatek yeah
23:05 TimToady it might be possible to have a non-invariant constraint, a "where-if-there" or so, modulo syntactic sugar
23:06 TimToady but we'd have to weigh how much mind-space such a feature would take wrt its benefitis
23:06 TimToady "benefititis" :)
23:07 dalek doc: 24bfc7d | (Francis Grizzly Smit)++ | doc/Type/Int.pod6:
23:07 dalek doc: Fixed a small bug in the doc
23:07 dalek doc: review: https://github.com/perl6/doc/commit/24bfc7d6cd
23:07 dalek doc: d51e018 | (Francis Grizzly Smit)++ | / (2 files):
23:07 dalek doc: Merge branch 'master' of github.com:perl6/doc
23:07 dalek doc:
23:07 dalek doc: so that my small change to the docs can go through
23:07 dalek doc: review: https://github.com/perl6/doc/commit/d51e018cd7
23:07 seatek well, coming from someone who got irritated by it, i'd say it's not worth it, now that i understand it. but if i didn't bother to understand it, i might be raving about how awful that was to be LIED to ;)
23:08 seatek but there's always RTFM
23:08 seatek and its in there
23:08 TimToady maybe it can serve as a shibboleth to weed out the rage quitters :)
23:09 seatek :) :) i like that. sure :)
23:10 TimToady much like Camelia weeds out the anti-joy curmudgeons :)
23:22 skids One of the other places we've seen complaints about this behavior is in layering subclass methods.
23:23 skids But the information IS available:
23:23 skids m: sub f (|c ($i, Int $j?)) { |c.perl.say; c[0,1].perl.say; $i.perl.say }; f(1)
23:23 camelia rakudo-moar d8309d: OUTPUT«\(1)␤(1, Nil)␤1␤»
23:23 skids Just ugly to get at.
23:24 skids So maybe syntactic relief for juggling Captures would help.
23:26 skids ...starting with a way to elide the |c in the signature just to get the full arglist, if we don't already have one.
23:28 skids |_ maybe.
23:29 skids But hopefully without any lexpad overhead.
23:29 sufrostico joined #perl6
23:30 lizmat joined #perl6
23:33 timotimo oops, what a brilliant way to fail; the GOP website just posted a bunch of articles on line, starting with the "results of tonight's VP debate"
23:33 skids lol.
23:33 timotimo another article starts with: Americans from all across the country tuned in to watch the one and only Vice Presidential debate. During the debate we helped fact check and monitor the conversation in real time @GOP. The consensus was clear after the dust settled, Mike Pence was the clear winner of the debate.
23:34 timotimo it'd be fantastic if hillary's VP read those articles and had perfect preparation for what this pence person was supposed to bring to the table
23:34 skids Well, OK, no need to hold the debate then.
23:35 timotimo Mike Pence’s top moments from the debate:
23:35 timotimo Economy
23:35 timotimo Highlighting Hillary’s scandals
23:35 SmokeMachine____ m: role A {method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {method a{say "B"; nextwith(:bla)}}; class C does B {}; C.a
23:35 camelia rakudo-moar d8309d: OUTPUT«B␤»
23:36 timotimo SmokeMachine____: i think the :$bla candidate isn't in the dispatcher when you "nextwith"
23:36 timotimo so you'd want to "callwith" instead
23:36 SmokeMachine____ m: role A {method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {method a{say "B"; callwith(:bla)}}; class C does B {}; C.a
23:36 camelia rakudo-moar d8309d: OUTPUT«B␤»
23:37 SmokeMachine____ timotimo: the same result... :(
23:37 timotimo hm
23:37 timotimo maybe it was another of those
23:37 timotimo oh, you don't have a multi
23:37 timotimo i thought you had a multi method there, but those are only methods
23:38 shin_ joined #perl6
23:39 SmokeMachine____ with multi nextwith, callwith and samewith only call the A version...
23:39 BenGoldberg joined #perl6
23:39 SmokeMachine____ m: role A {multi method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {multi method a{say "B"; callwith(:bla)}}; class C does B {}; C.a
23:39 camelia rakudo-moar d8309d: OUTPUT«A␤»
23:39 SmokeMachine____ m: role A {multi method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {multi method a{say "B"; nextwith(:bla)}}; class C does B {}; C.a
23:39 camelia rakudo-moar d8309d: OUTPUT«A␤»
23:39 SmokeMachine____ m: role A {multi method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {multi method a{say "B"; samewith(:bla)}}; class C does B {}; C.a
23:39 camelia rakudo-moar d8309d: OUTPUT«A␤»
23:40 SmokeMachine____ timotimo: ^^
23:40 bjz joined #perl6
23:40 skids Optional nameds aren't considered in MMD, no?
23:40 timotimo well, ideally you'd make :$bla!
23:40 timotimo that's right
23:41 SmokeMachine____ m: role A {method a(:$bla){say "A"; say "bla" if $bla}}; role B does A {method a{say "B"; self.A::a(:bla)}}; class C does B {}; C.a
23:41 camelia rakudo-moar d8309d: OUTPUT«B␤No concretization found for A␤  in any concretization at gen/moar/m-Metamodel.nqp line 3151␤  in any find_method_qualified at gen/moar/m-Metamodel.nqp line 1117␤  in method a at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:41 timotimo interesting. so that only works with classes, not with roles?
23:42 SmokeMachine____ what means concretization?
23:42 timotimo "more explicit selection" or something?
23:42 SmokeMachine____ timotimo: im not sure...
23:42 skids A class or punned class.
23:43 SmokeMachine____ thanks
23:44 SmokeMachine____ is that right to that does not work?
23:44 SmokeMachine____ How could I do that work?
23:44 skids Do you need A's a to ave an optiona :bla or coud it be mandatory?
23:45 skids joined #perl6
23:45 skids Grr. something turned mouse gestures on.
23:45 lucasb_ joined #perl6
23:46 SmokeMachine____ I need to call B::a and it calls A::a with a argument (that argument is optional in A)
23:46 SmokeMachine____ A is JSON::Class and :bla is :skip-null
23:46 timotimo you can try "role B is A"
23:46 timotimo instead of "role B does A"
23:47 SmokeMachine____ I can't... A is JSON::Class... JSON::Class is a role... an I "is" a role?
23:47 timotimo try it
23:48 SmokeMachine____ just worked!
23:48 SmokeMachine____ m: role A {method a(:$bla){say "A"; say "bla" if $bla}}; role B is A {method a{say "B"; nextwith(:bla)}}; class C does B {}; C.a
23:48 camelia rakudo-moar d8309d: OUTPUT«B␤A␤bla␤»
23:48 SmokeMachine____ thank you guys!
23:48 BenGoldberg joined #perl6
23:48 timotimo YW
23:54 shin_ Hi all... i have to solve a problem but i'm not sure how to build it with the perl6 primitives.
23:55 shin_ my %a = ('shell',True  ,  'weight',1  ,  'origin','animal'); my %t = ('shell',False  ,  'weight',{ "some code that reduces the value by 5%" });
23:55 vytas joined #perl6
23:55 shin_ %a is a collection of `attributes`, %t does a `transformation` that modifies the `attributes` that are known to it (we can call this example, 'crack the egg').
23:55 shin_ My objective is to build a class for applying the code in %t to values on %a
23:56 shin_ in this case, %a-after-t = ('shell',False  ,  'weight',0.95  ,  'origin','animal');
23:56 timotimo so like { $_ * 0.95 } ?
23:56 shin_ the question: How should i model the *code* part? All code parts are meant to modify one and only one value, but can query other attributes?
23:57 shin_ and, how could i persist such thing in a file to reuse later?
23:57 lucasb_ say { $_ * 5/100 }(10)
23:57 timotimo persisting code is a lot harder
23:59 lucasb_ what do you mean by persisting? isn't it just a matter of writing this rules in the form of code in a source file? :)
23:59 shin_ should i create a SDL and a parser then? Also, the idea is also that the code inside any atribute can look 'outside', not to produce side effects, but to know other importat info to use in the transformation.

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

Perl 6 | Reference Documentation | Rakudo