Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-06-01

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 buggable And the winning number is 7! Congratulations to alphah! You win a can of WD40!
00:05 troys joined #perl6
00:07 * dwarring heh
00:10 mcmillhj joined #perl6
00:11 BenGoldberg WD40 is good for half as many things as perl ;)
00:24 pilne why would google ban for using it to get time in different locations????
00:25 mcmillhj joined #perl6
00:29 ugexe https://www.youtube.com/watch?v=EIDZn8NHHfM perl6 graphql live talk
00:39 lookatme joined #perl6
00:39 lookatme morning .o/
00:41 mcmillhj joined #perl6
00:56 BenGoldberg Does anyone know if there's a perl6 binding for Glib?  In particular, GObject Introspection?
00:56 Cabanossi joined #perl6
00:57 mcmillhj joined #perl6
00:57 pilne buggable: tag glib
00:57 buggable pilne, There are no tickets tagged with GLIB
00:57 pilne whoops wrong bot
00:58 pilne grebbable6: glib
00:58 greppable6 pilne, https://gist.github.com/15719059ecdd0ce448e61e8561a45dd8
00:58 pilne that thing is quite nifty
00:59 BenGoldberg greppable6: \bglib\b
00:59 greppable6 BenGoldberg, https://gist.github.com/042ff1d0975d073d84f7d6e7a1b18d96
01:04 BenGoldberg A heap of modules which *depend* on glib, but nothing exposing glib itself
01:04 Actualeyes joined #perl6
01:08 pilne i'm new here too
01:09 pilne although it might be possible to use a perl5, python, or ruby wrapper with the inline modules.
01:12 mr-foobar joined #perl6
01:13 mcmillhj joined #perl6
01:14 mcmillhj_ joined #perl6
01:20 mcmillhj joined #perl6
01:26 Cabanossi joined #perl6
01:41 lookatme How to create a role with meta-object protocol like class ?
01:46 mcmillhj_ joined #perl6
01:46 ugexe m: role Foo { .^add_method("^shit", method { die "shit" }) }; class Bar does Foo { }; Foo.new.^shit
01:46 camelia rakudo-moar 8ec181: OUTPUT: «Could not instantiate role 'Foo':␤Package 'Mu' already has a method '^shit' (did you mean to declare a multi-method?)␤  in any protect at gen/moar/stage2/NQPCORE.setting line 1029␤  in block <unit> at <tmp> line 1␤␤»
01:46 ugexe heh, guess not
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:50 lookatme ugexe, oh, thanks. Another question, do you know how can I add an attribute declare with HAS(not has) with meta-object protocol ?
01:53 lookatme m: role A { }; say A.HOW;
01:53 camelia rakudo-moar 8ec181: OUTPUT: «Perl6::Metamodel::ParametricRoleGroupHOW.new␤»
01:53 lookatme This metamodel class not have document yet.
01:59 skids ParametricRoleGroup is an abstract role group from which a ParametricRole has not yet been chosen.
02:00 skids m: role Foo [1] { }; role Foo [2] { }; say Foo[1] ~~ Foo # the last Foo is a ParametricRoleGroup, IIRC.
02:00 camelia rakudo-moar 8ec181: OUTPUT: «True␤»
02:00 mcmillhj_ joined #perl6
02:00 skids But roles are only lazily collapsed, and even non-parametric ones are actually paramteric under the hood.
02:01 skids To get meta object protcol on a role need to figure out how to collapse it from ParametricRoleGroup to ParametricRole without collapsing all the way to CurriedRole
02:01 skids I don't know how to do that off the top of my head.
02:02 pilne any idea where i need to start looking to fix this up?: https://gist.github.com/anonymous/c8aef88bd4feabd2a4097b538da411bd
02:03 lookatme skids, me too, there are not document about that.
02:03 lookatme s/not/no/
02:03 skids m: role Foo[$n] { }; my \c = Foo[1]; c.WHAT.say; c.^add_method("^covfefe", method { die "covfefe!" }); class Bar does Foo[1] { }; Foo[1].new.^covfefe # Collapsed too far.
02:03 camelia rakudo-moar 8ec181: OUTPUT: «(Foo[Int])␤No such method 'add_method' for invocant of type 'Perl6::Metamodel::CurriedRoleHOW'␤  in block <unit> at <tmp> line 1␤␤»
02:04 lookatme What's the mean of `propdivsum($)`, pilne
02:04 lookatme The `$`
02:05 pilne goddamnit
02:05 pilne that's the second time today i've done that
02:05 pilne ty lookatme
02:06 cdg joined #perl6
02:09 skids m: role Foo { }; my \c = Foo; c.^candidates[0].^add_method("^covfefe", method { die "covfefe!" }); class Bar does Foo { }; c.^candidates[0].^methods[0](c);
02:09 camelia rakudo-moar 8ec181: OUTPUT: «covfefe!␤  in method <anon> at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:13 skids m: role Foo { }; my \c = Foo; c.^candidates[0].^add_method("covfefe", method { die "covfefe!" }); class Bar does Foo { }; Foo.new.covfefe.say
02:13 camelia rakudo-moar 8ec181: OUTPUT: «covfefe!␤  in method <anon> at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:16 mcmillhj_ joined #perl6
02:17 cdg joined #perl6
02:20 lookatme m: role A {}; say A.HOW.^methods;
02:20 camelia rakudo-moar 8ec181: OUTPUT: «No such method 'gist' for invocant of type 'NQPRoutine'␤  in block <unit> at <tmp> line 1␤␤»
02:21 mcmillhj_ joined #perl6
02:28 Miller_d joined #perl6
02:30 cbd_ noob question: does rakudo pass all the test as github.com/perl6/roast?
02:31 cbd_ s/as/at/
02:37 geekosaur no, there are a number skipped as Not Yet Implemented or TODO
02:37 geekosaur i.e. known deviations
02:40 xinming_ joined #perl6
02:40 cbd_ Okay. I've never contributed to open source, or given a pull request before...
02:40 cbd_ And I believe I've found a bug in Rakudo, and submitted one, but I figured that adding a test for the issue on perl6/roast would also help
02:41 cbd_ how do I do that?
02:42 cbd_ Or better: which direct should I head in? Just send someone an email through github and they're sort things out?
02:42 cbd_ s/direct/direction/
02:42 cbd_ good grief, excuse the incorrect words
02:46 MasterDuke cbd_: click the "fork" button here https://github.com/perl6/roast, clone your fork to your computer, create and checkout a branch, add and commit and push your change, then click the "new pull request" button back on https://github.com/perl6/roast
02:50 noganex_ joined #perl6
02:50 cbd_ ok thanks
02:51 cbd_ and they'll let me know if they don't think it is a bug that needs a test/ or if they don't like the test or whatever
02:52 MasterDuke yep. you said you already created an RT ticket?
02:53 cbd_ yes, but there hasn't been any action on the ticket
02:53 cbd_ yet
02:53 Zoffix joined #perl6
02:53 MasterDuke what's the number?
02:53 Zoffix cbd_: what's the ticket and what's the bug?
02:54 cbd_ https://rt.perl.org/Public/Bug/Display.html?id=131381
02:54 Zoffix Hm. Looks like perl6.fail hasn't been updated for hours
02:56 cbd_ The bug is that a sub can't declare a parameter of type Array of Subset
02:57 Zoffix cdg: sidenote: we already have PositiveInt subset in core under the name UInt
02:57 Zoffix m: say -5 ~~ UInt; say 5 ~~ UInt
02:57 camelia rakudo-moar 8ec181: OUTPUT: «False␤True␤»
02:57 lookatme Seems like I have seen this bug before.
02:58 cbd_ I confess I did not really check through RT to see if this bug already existed
02:59 cbd_ Zoffix: Looking though perl6/roast I just noticed that (type Int::Positive), was just using that as a simple example to showcase the bug
02:59 Zoffix Seems to work if you use `(Array[UInt] $x)`
03:00 cbd_ oh hey, so it does
03:00 Zoffix cdg: it's not always the easiest task :) Though https://perl6.fail/ lists all the open tickets on one page so it's a bit easier.
03:01 Zoffix m: -> UInt @ {}(Array[UInt].new)
03:01 camelia rakudo-moar 8ec181: OUTPUT: «Constraint type check failed in binding to parameter '<anon>'; expected UInt but got Array[UInt] (Array[UInt].new())␤  in block <unit> at <tmp> line 1␤␤»
03:01 Zoffix golfed
03:02 cbd_ it is supposed to work as I originally wrote it? it is a legitimate bug?
03:03 Zoffix cbd_: yeah, it's a bug
03:03 lookatme m: subset PInt of Int where * > 0; sub f(PInt @p) { }; my PInt @a; f(@a)
03:03 camelia rakudo-moar 8ec181: OUTPUT: «Constraint type check failed in binding to parameter '@p'; expected PInt but got Array[PInt] (Array[PInt].new())␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
03:04 Zoffix cdg: as for tests. Yeah, as was described, clone the perl6/roast repo, find some relevant file to put the test in, bump the `plan` at the top by the number of tests you're adding, add the test. Check the file works by running `t/fudgeandrun S-watever/your-test.t` and if it's all pass, then submit a PR.
03:05 Zoffix There are a few articles on perl6.party (with "core hacking" in titles) that mention the test-writing process
03:05 Zoffix And then "they" will comment on the PR or merge it :)
03:06 cbd_ t/fudgeandrun came with Rakudo*?
03:06 Zoffix cdg: it's a script in perl6/roast repo
03:06 Zoffix cdg: oh, sorry, if you're in roast checkout, it should be just ./fudgeandrun some-test-file.t
03:07 Zoffix This is the script: https://github.com/perl6/roast/blob/master/fudgeandrun
03:09 pilne so far 100% of my bugs have just been my babelfish going too deep into my ear >.<
03:10 Cabanossi joined #perl6
03:12 mr-foobar joined #perl6
03:13 Zoffix AST shows it typechecking for Positional[Int] and then typechking with UInt :S
03:15 MasterDuke ha
03:16 awwaiid joined #perl6
03:18 cdg_ joined #perl6
03:19 * Zoffix doesn't know how any of this stuff works, gives up, and hopes MasterDuke will figure it out :)
03:19 Zoffix night \o
03:19 Zoffix left #perl6
03:20 MasterDuke well, not tonight for sure, about to head to bed myself
03:21 awwaiid joined #perl6
03:38 cbd_ joined #perl6
03:59 dj_goku joined #perl6
04:01 Kaffe joined #perl6
04:12 xerx joined #perl6
04:19 xerx joined #perl6
04:39 mcmillhj joined #perl6
04:44 xtreak joined #perl6
04:44 Ben_Goldberg joined #perl6
04:53 curan joined #perl6
05:04 AlexDaniel joined #perl6
05:13 ufobat joined #perl6
05:25 Cabanossi joined #perl6
05:31 domidumont joined #perl6
05:37 domidumont joined #perl6
06:01 domidumont joined #perl6
06:06 wamba joined #perl6
06:10 Cabanossi joined #perl6
06:11 klapperl joined #perl6
06:13 mr-foobar joined #perl6
06:24 xtreak joined #perl6
06:39 Cabanossi joined #perl6
07:00 sammers joined #perl6
07:13 mr-foobar joined #perl6
07:15 darutoko joined #perl6
07:21 salva joined #perl6
07:22 rindolf joined #perl6
07:31 dakkar joined #perl6
07:32 parv joined #perl6
07:54 kalkin- joined #perl6
07:56 aborazmeh joined #perl6
07:56 aborazmeh joined #perl6
07:56 g4 joined #perl6
07:56 g4 joined #perl6
08:00 jonas2 joined #perl6
08:01 nadim_ joined #perl6
08:05 zakharyas joined #perl6
08:12 cpage_ joined #perl6
08:14 timotimo perl6.fail: Frontend for All Interesting Lapses
08:16 xtreak joined #perl6
08:17 kalkin- joined #perl6
08:29 kalkin- joined #perl6
08:35 domidumont joined #perl6
08:44 mr-foobar joined #perl6
08:47 cyphase joined #perl6
08:54 lowbro joined #perl6
08:55 lowbro joined #perl6
09:07 wamba joined #perl6
09:09 Cabanossi joined #perl6
09:34 dakkar joined #perl6
09:40 pmurias joined #perl6
09:41 mr-foobar joined #perl6
09:42 geekosaur joined #perl6
09:44 simonm joined #perl6
10:17 margeas joined #perl6
10:20 robertle joined #perl6
10:40 Cabanossi joined #perl6
10:42 mr-foobar joined #perl6
10:45 cpage_ joined #perl6
10:45 notbenh joined #perl6
10:47 simonm joined #perl6
11:15 mr-foobar joined #perl6
11:29 grondilu ls
11:29 grondilu ^sorry
11:39 zengargoyle that GraphQL prestenation was pretty cool even with google hangout technical difficulties.
11:40 Cabanossi joined #perl6
11:40 zengargoyle *presentation
11:44 curt_ joined #perl6
12:03 domidumont joined #perl6
12:07 mcmillhj joined #perl6
12:10 Cabanossi joined #perl6
12:13 khw joined #perl6
12:15 simonm joined #perl6
12:40 Cabanossi joined #perl6
12:42 pilne joined #perl6
12:50 wamba joined #perl6
12:52 * pilne yawns
12:56 cdg joined #perl6
13:11 mr-foobar joined #perl6
13:19 raschipi joined #perl6
13:46 mr-foobar joined #perl6
13:47 AlexDaniel joined #perl6
13:55 Cabanossi joined #perl6
14:00 dct joined #perl6
14:02 rindolf joined #perl6
14:05 skids joined #perl6
14:10 tbrowder question: is there a rule of thumb about the order of declaring vars in a script? i have a messy script that was working reasonably well but suddenly, after an unknown change (haven't checked git history yet), file scope vars defined early in the script are now throwing an undeclared error when referenced later. i also have a scattering of constants. should i always declare all such mutable vars at the top (after any modules)
14:10 tbrowder and define initial values in a BEGIN block as a matter of course?
14:13 masak tbrowder: I'm kind of partial to the rule of "declare a variable at the latest possible point (when you need it), in the smallest possible scope"
14:13 lucs masak++
14:13 El_Che masak: constants are an exception, surely?
14:13 lucs Constants aren't variables ;)
14:14 masak El_Che: yes, but I'm not super-strict about putting them at the top either
14:14 masak but yeah, they are more likely to go at the top
14:14 El_Che lucs: haha, excellent point
14:15 masak tbrowder: anyway, something about your question tells me you're somewhat overwhelmed by too many variables in too wide scopes. I find that doesn't happen to me so much these days.
14:15 masak (not because I'm more clever than before -- I wish -- but because I try to constrain the scope of my variables)
14:15 lucs The fewer globals, the better, eh.
14:16 masak I even greatly appreciate linters these days that tell me when I have unused variables, or variables that I've declared but not assigned to, etc
14:18 masak those things are not compiler errors, but they're indicative of loose ends and I like to have them pointed out to me
14:18 lucs masak: Does P6 have such tools as far as you know?
14:18 El_Che masak: they are compiler errors in languages like go
14:18 rightfold Don't write messy code and you won't have those problems
14:18 rightfold Not even to "fix it in a minute"
14:18 rightfold It does not make you go faster in the short or long term
14:18 lucs rightfold: We all strive to avoid messy code, but, you know, things happen :)
14:23 timotimo tbrowder: don't forget that for "constant foo = bar" you already get BEGIN semantics
14:24 timotimo m: constant first-time = now; BEGIN sleep 2; constant second-time = now; say second-time - first-time
14:24 camelia rakudo-moar 92c187: OUTPUT: «2.05492837␤»
14:32 rightfold Woot
14:33 rightfold That's rad
14:33 timotimo it can be unexpected when you move code from a script to a module
14:34 timotimo and suddenly precompilation lets the code run less often
14:34 timotimo this is also why we don't offer "assign-once constants" under the "constant" keyword
14:35 tbrowder masak: i agree, but i'm in a "messy" dev state at the moment and haven' taken time to refactor and hide stuff yet...
14:36 tbrowder masak: you are right, of course, thanks
14:36 tbrowder timotimo: thanks
14:39 wamba joined #perl6
14:45 mr-foobar joined #perl6
14:45 Geth ¦ doc: 6e00889cca | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Proc/Async.pod6
14:45 Geth ¦ doc: Fix Proc::Async.new
14:45 Geth ¦ doc:
14:45 Geth ¦ doc: - There's no :$path, *@args candidate
14:45 Geth ¦ doc: - There's no `:r` argument
14:45 Geth ¦ doc: - Include the positional multi
14:45 Geth ¦ doc: - Include :enc and :translate-nl args
14:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6e00889cca
15:05 wamba joined #perl6
15:14 zapwai joined #perl6
15:28 committable6 joined #perl6
15:41 Geth ¦ doc: 8f695f2d22 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Proc/Async.pod6
15:41 Geth ¦ doc: Fix typo; Fixes #1354
15:41 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8f695f2d22
15:41 tbrowder ref my prob: found a "=comment" that was meant to be an "=end comment", fixed and turned on torrent of errors, need to use a linter (not sure it would be easy to find that, though, given that p6 pod can have nested comments and no worries running through to eof).
15:42 [Coke] syntax highlighter might've been helpful there.
15:43 troys joined #perl6
15:46 zacts joined #perl6
15:50 pilne joined #perl6
16:02 Sgeo joined #perl6
16:09 tbrowder my real error was not using my git history (actually, bzr) when the error popped up (and my emacs perl6-mode doesn't have a highlighter, anyway)
16:16 mr-foobar joined #perl6
16:19 Do joined #perl6
16:20 this joined #perl6
16:20 this Hi
16:37 domidumont joined #perl6
16:38 zacts joined #perl6
16:40 Cabanossi joined #perl6
16:41 Zoffix joined #perl6
16:41 Zoffix left #perl6
16:42 mcmillhj joined #perl6
16:45 mr-foobar joined #perl6
16:47 kalkin- joined #perl6
16:48 setty1 joined #perl6
16:51 robertle joined #perl6
16:59 mcmillhj joined #perl6
17:08 Actualeyes joined #perl6
17:15 mr-foobar joined #perl6
17:23 st_elmo joined #perl6
17:36 wamba joined #perl6
17:43 mr-foobar joined #perl6
17:55 aindilis` joined #perl6
17:57 CacoS joined #perl6
18:48 raschipi joined #perl6
18:55 Cabanossi joined #perl6
19:03 moritz hi all. I'm considering writing something about P6 regexes and grammars. Here's a first draft of an outline: https://gist.github.com/moritz/471edf9f7161971ba0b5365d3526bb8e
19:03 moritz feedback would be very welcome
19:04 Exodist joined #perl6
19:07 curt_ m: my Array[Int] $x; say $x>>.Str;
19:07 camelia rakudo-moar 92c187: OUTPUT: «(timeout)»
19:15 timotimo bisectable6: my Array[Int] $x; say $x>>.Str;
19:15 bisectable6 timotimo, On both starting points (old=2015.12 new=92c187d) the exit code is 0, exit signal is 1 (SIGHUP) and the output is identical as well
19:15 bisectable6 timotimo, Output on both points: ««timed out after 10 seconds»»
19:16 timotimo huh, it has been like this forever
19:18 moritz m: my Array[Int] $x; say $x.new()>>.Str;
19:18 camelia rakudo-moar 92c187: OUTPUT: «[]␤»
19:18 moritz m: my Array[Int] $x; say $x.defined
19:18 camelia rakudo-moar 92c187: OUTPUT: «False␤»
19:27 Actualeyes joined #perl6
19:31 Zoffix joined #perl6
19:33 Zoffix It's a bug in &deepmap, needs `&& $value.DEFINITE` on this line, at a guess: https://github.com/rakudo/rakudo/blob/92c187d/src/core/Rakudo/Internals.pm#L1489
19:33 Zoffix Need to relocate and will fix in ~2hrs.
19:33 Zoffix m: dd Array.list
19:33 camelia rakudo-moar 92c187: OUTPUT: «(Array,)␤»
19:34 Zoffix ^ it basically makes a 1-el list of Array type object, then goes to descend into it and finds the inner Array and recurses and makes 1-el list with the type object and hence infiniloop :)
19:35 eater What's the difference between <50/7> and (50/7)?
19:35 moritz m: say .^name for <50/7>, (50/7)
19:35 camelia rakudo-moar 92c187: OUTPUT: «Rat␤Rat␤»
19:35 Zoffix eater: the first one is a Rat literal, the second one is two Ints divided with the &infix:</> operator. The former can be used as a literal in the signature, for example, the latter can't as it';s an expression not a literal
19:36 eater thanks :)
19:36 eater Rat's are rad
19:37 awwaiid Rats are the BEST!
19:37 Zoffix They're indeed delicious!
19:38 Zoffix Oh, we're talking about Perl 6 objects?
19:38 awwaiid I want all the langs to switch to Rats by default
19:40 Cabanossi joined #perl6
19:41 Zoffix curt_++ # thanks for presenting about Perl 6 last night!
19:42 Zoffix GraphQL and Perl 6 if anyone wanna watch: https://www.youtube.com/watch?v=EIDZn8NHHfM
19:43 raschipi moritz: what about using a regex with .grep? It's not included in the 'Using Regexes' section.
19:43 curt_ I love Perl 6... It makes a perfect partner for GraphQL
19:43 Zoffix :)
19:44 moritz raschipi: I'll certainly mention that (though it's "just another" application of smart matching)
19:45 raschipi It's the most common regexp use, and I think giving a simple example is nice.
19:48 huggable joined #perl6
19:49 raschipi A section on Grammar::Debugger would also be nice, giving the ropes on how to use it.
19:49 eater hmm those NF* functions are new?
19:50 simcop2387 joined #perl6
19:51 captain-adequate joined #perl6
19:51 Zoffix Well, I lied. I was able to fix it before relocating \o/
19:51 Zoffix m: my Array[Int] $x; say $x>>.gist;
19:51 camelia rakudo-moar 252dbf: OUTPUT: «[(Array[Int])]␤»
19:52 Zoffix Drive-by bug fixing.... zoom ZOOM!
19:52 Zoffix left #perl6
20:04 cdg joined #perl6
20:15 espadrine_ joined #perl6
20:37 circ-user-HlKVf joined #perl6
20:40 Cabanossi joined #perl6
20:50 tbrowder .tell dwarring i just filed a new issue for Font::AFM
20:50 yoleaux tbrowder: I'll pass your message to dwarring.
20:59 tbrowder the issue i found is that the IsFixedPitch method is returning a string of 'true' or 'false', not a Boolean (to be fair, that what the README says), so a Boolean test shows no difference, one has to test for 'true'. is there any way to coerce those strings to a Boolean?
21:03 raschipi The other way around, turning it into a String when it's a boolean is trivial in P6, so it makes sense to return the Bool.
21:04 raschipi bye my loves
21:10 TEttinger joined #perl6
21:18 grondilu joined #perl6
21:28 ufobat ${ ... } is an itemized hash, right? so when is {} an itemized has and when is {} a code-block-thingy?
21:28 ufobat m: say ('GET' => {foo => 1}).value.WHAT
21:28 camelia rakudo-moar 252dbf: OUTPUT: «(Hash)␤»
21:29 pmurias joined #perl6
21:29 Geth ¦ doc: d3d3fa3666 | (Jan-Olof Hendig)++ | doc/Language/functions.pod6
21:29 Geth ¦ doc: Fixed a few typos
21:29 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d3d3fa3666
21:29 pilne my roguelike obsession is really nagging at me... i think i might pickup timotimo's libtcod bindings and also implement a pure perl6 one, just for yaknow.... poops and giggles perhaps they are both just out of my comfort zone as projects tbh, but i don't think that they are so far as to be something i'll hate myself for doing.
21:32 kyan joined #perl6
21:37 Juerd Search appears broken on doc.perl6.org
21:37 Juerd Especially short things like "io" or "try" don't get you anywhere near what you're looking for.
21:39 [Coke] Juerd: there's a fuzzy search, which may be slightly too fuzzy. Additionally, exact matches are not preferred.
21:39 * [Coke] hurls https://github.com/perl6/doc/issues?q=is%3Aissue+is%3Aopen+label%3Asearch for a list of currently open search related issues which probably cover this.
21:39 Juerd Er, I wouldn't call this "slightly" too fuzzy :)
21:39 [Coke] https://github.com/perl6/doc/issues/247 in particular.
21:39 Cabanossi joined #perl6
21:40 [Coke] Juerd: search for "routne" for example.
21:40 colomon_ joined #perl6
21:40 Juerd Sure, try "try"
21:40 pmurias joined #perl6
21:40 Juerd I'd make a screenshot but the drop-down closes as soon as the input field loses focus.
21:40 [Coke] I see it, yes.
21:41 Juerd So, yep, pretty fuzzy :)
21:43 [Coke] for things that are short, we shouldn't return even shorter things.
21:43 [Coke] say, if the term length is 4 or less, only return matches that are least 4 long?
21:43 Juerd Not just that, "try" should also not return things like "utc", "rwx", or "ord"
21:43 [Coke] that would cut that list down a bit, but perhaps not too much.
21:44 Juerd Or maybe it should find those things, but prioritize exact matches, then substrings, and then fuzziness
21:44 [Coke] right, the ordering of results is one ticket that's already out there. reducing the fuzz set would be something else. we have a few knobs we can try there.
21:45 [Coke] Can you open a ticket and assign it to me?
21:46 Juerd I have no idea if I can do that
21:46 Juerd I'll try :)
21:47 [Coke] danke
21:48 dwarring tbrowder: got it thanks!
21:48 yoleaux 20:50Z <tbrowder> dwarring: i just filed a new issue for Font::AFM
21:49 committable6 joined #perl6
21:54 mcmillhj joined #perl6
21:59 itaylor57 joined #perl6
21:59 [Coke] Juerd: I think the result you're looking for, btw, is under "try blocks"
22:00 Juerd Could be. I'd expect an exact match for keywords, though.
22:00 Juerd Especially since try can be used without a block :)
22:01 [Coke] ok, that's an actual doc issue, then, rather than a search-js-bug.
22:01 Juerd (Note: I'm trying to use Perl 6 for an actual project, so not taking the time to figure out how I can help to fix bugs or documentation; I'll just work around anything I encounter)
22:02 [Coke] I'll copy the ticket and deal with at least one of those 2 issues. :)
22:02 Juerd Great, thanks :)
22:02 [Coke] Juerd: sure; thanks for opening the ticket, it helps.
22:03 Juerd Another thing I'm working around is that serializing an object with "has Hash @foo" to/from json is hard, because after deserializing, it complains that the array is not a hash... Working around it simply by removing the type constraint. Finding out what I'm doing wrong takes too long :)
22:05 Juerd I'm falling in love with if ... -> $x { ... }
22:08 pilne it is quite elegant and useful
22:08 timotimo don't forget about the wonderful with ... -> $x { ... } as well
22:09 Juerd timotimo: I can't stand with/without because my brain can't be convinced they're conditionals.
22:09 Cabanossi joined #perl6
22:10 Juerd timotimo: It messes with my comprehension of my own code if I use them.
22:10 mcmillhj joined #perl6
22:11 pilne i'm noticing in a couple of SO questions and tutorials the line "... you can use $ for everything and ignore @ and %..." (one in context of using a % for something associative that isn't a hash, and the other in the docs on nativecall)
22:11 pilne and i'm quite confused
22:13 jnthn In certainly contexts it may be true, but I don't think it's good general advice.
22:14 pilne k, i'll generally ignore it then (:
22:14 Juerd Heh, sigils were simplified but continue to confuse newbies :)
22:14 jnthn Not least because `my $x = Array.new; $x = ...` means something totally different to `my @x = ...`
22:15 jnthn If you move the sigils off the variables, you'll end up with them (or their method equivalents) at usage sites.
22:15 majensen1 joined #perl6
22:15 jnthn And then the code will look like @$blah :)
22:18 pilne i've never been adverse to sigils or sigil-esq things (like clojure using [] {} () for different data types) to make it immediately apparent what something is. although having the sigil on the name of the thing makes it a lot easier to not have to dig back up (or down...) in code to find out exactly "what" that thing is (:
22:19 haxmeister joined #perl6
22:26 mcmillhj joined #perl6
22:33 mcmillhj joined #perl6
22:41 Juerd "Unsupported use of $. variable; in Perl 6 please use the .kv method on e.g. .lines" when trying $.^name instead of self.^name; bug or my mistake?
22:47 AlexDaniel m: class Foo { method foo { say $\.^name } }; Foo.new.foo
22:47 camelia rakudo-moar 252dbf: OUTPUT: «Any␤»
22:47 AlexDaniel ah no, this is doing something else
22:48 AlexDaniel or… does it?
22:48 AlexDaniel m: class Foo { method foo { say ($).^name } }; Foo.new.foo
22:48 camelia rakudo-moar 252dbf: OUTPUT: «Any␤»
22:48 AlexDaniel m: class Foo { method foo { say (self).^name } }; Foo.new.foo
22:48 camelia rakudo-moar 252dbf: OUTPUT: «Foo␤»
22:49 AlexDaniel right, because… because that's an anon variable I think
22:50 AlexDaniel Juerd: bug.
22:53 AlexDaniel Juerd: I think this is where you would fix it: https://github.com/rakudo/rakudo/blob/8e0d000fbbe1a1430695ac5dbed5bce505d89a05/src/Perl6/Grammar.nqp#L2080-L2083
22:54 AlexDaniel like, maybe this: !before ‘^’? \w
22:55 Juerd Mind if I copy/paste that into a ticket?
22:55 AlexDaniel sure
22:56 AlexDaniel Juerd: you can fix it yourself if you have time
22:57 Juerd Can't find the RT email address :(
22:57 Juerd AlexDaniel: That's the thing, I don't...
22:57 AlexDaniel huggable: rakudobug
22:57 huggable AlexDaniel, Report bugs by emailing to rakudobug@perl.org
22:57 Juerd AlexDaniel: I'm not sure if I'm wasting time by using Perl 6 for actual work, or saving time
22:58 AlexDaniel well, $.^name issue doesn't take any time, just use self. :)
22:58 Juerd It's very little code compared to what I'd need if I had to put type checks everywhere in Perl 5
22:58 AlexDaniel For now, I mean
22:58 Juerd But I've already run into a handful of issues in 2 hours of coding :)
22:58 Juerd Yep, I'm happily working around anything I find
22:59 itaylor57 joined #perl6
22:59 AlexDaniel Juerd: well, actually we need more people like you using perl 6 for real stuff
23:02 Juerd Mail sent
23:09 Herby_ joined #perl6
23:09 Herby_ o/
23:09 timotimo yo herb
23:10 Herby_ hey timotimo
23:13 Herby_ I'm working my way through the Think Perl 6 book and am stumped on an example
23:14 Herby_ https://gist.github.com/anonymous/bc6f0e583ff36d8c1274d0875fcdefc4
23:14 Herby_ whether the user enters 1 or 50000, it will say One digit
23:16 timotimo huh, interesting
23:16 Herby_ I'm guessing its due to perl not making the user input a integer when it enters the given statement?
23:16 timotimo m: say "50000" ~~ 0..9
23:16 camelia rakudo-moar b667e8: OUTPUT: «True␤»
23:16 timotimo bisect: say "50000" ~~ 0..9
23:16 bisectable6 timotimo, On both starting points (old=2015.12 new=b667e81) the exit code is 0 and the output is identical as well
23:16 bisectable6 timotimo, Output on both points: «True»
23:16 timotimo how does string vs int-range work ...
23:17 jeek m: say "50000" == 0
23:17 camelia rakudo-moar b667e8: OUTPUT: «False␤»
23:17 jeek m: say "50000" == -1
23:17 camelia rakudo-moar b667e8: OUTPUT: «False␤»
23:17 jeek m: say "50000" == 1
23:17 camelia rakudo-moar b667e8: OUTPUT: «False␤»
23:17 jeek Hrm.
23:17 timotimo ah, lexicographic
23:17 timotimo it only does int vs int if both the target and value are ints
23:18 timotimo m: say val("50000") ~~ 0..9
23:18 camelia rakudo-moar b667e8: OUTPUT: «False␤»
23:18 timotimo we may want to give prompt the "val" treatment? so we can get IntStr and such?
23:18 Herby_ say "50000".Int ~~ 0..9
23:18 evalable6 Herby_, rakudo-moar b667e818c: OUTPUT: «False»
23:18 Herby_ say "50000".Int ~~ 45000..55000
23:18 evalable6 Herby_, rakudo-moar b667e818c: OUTPUT: «True»
23:19 timotimo has think perl already been printed?
23:19 Herby_ i got the early release a few months back but yes i believe its gone into print
23:19 timotimo ah, perhaps it has been fixed since then
23:19 Herby_ i'm reading the ebook
23:19 Herby_ eh, i downloaded the newest copy a few days ago
23:20 Herby_ In my novice opinion the book is great. That example just stood out to me
23:22 timotimo thanks for pointing it out anyway :)
23:23 timotimo i'm not sure the author's reading the irc, though
23:24 Herby_ and to be fair, the example doesn't ask for user input. the book example starts at the given statement
23:24 timotimo oh, ok
23:24 timotimo right, so the example was expecting Int rather than Str
23:25 Herby_ likely, i added the user input part to test it
23:27 Juerd I'm slightly amazed that "my Foo|Bar @x" is not supported. Working around it with "my @x where Foo|Bar", but I wonder why the former can't work
23:36 timotimo hm, perhaps because you can't just put a Foo|Bar into an empty slot if the array grows or something
23:38 timotimo going to bed, seeya
23:38 Juerd Good night!

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

Perl 6 | Reference Documentation | Rakudo