00:00 canopus joined 00:05 telex joined
kurahaupo Zoffix: qualitatively yes, quantitatively no 00:10
faster is more actions per unit of time 00:11
Zoffix which is equivalent to one action per smaller unit of time ¯\_(ツ)_/¯ 00:13
kurahaupo Zoffix: numerically no
that's why you got a negative answer initially
Zoffix I got a negative answer because I was too lazy to type abs() for relative difference formula :) [one of] which is abs($a-$b)/max(abs($a), abs($b)) 00:14
m: my $a = 1 + 28.933/60; my $b = 2 + 1.467/60; say "{abs($a-$b)/max(abs($a), abs($b))*100}% faster" 00:15
camelia rakudo-moar e9019e: OUTPUT«26.7842295% faster␤»
kurahaupo no, you actually got the right answer -- the change in time was -26%
Zoffix After I rearranged the formula to not need abs/max, sure. 00:16
timotimo Zoffix: you may prefer infix:<max> over &max in this case 00:17
although it doesn't bind tighter than / does
so you'll need parens either way :\
00:18 mcsnolte left 00:19 rgrinberg left
kurahaupo Zoffix: if minutes-per-run decreases by 26% (less time), then runs-per-minute increases by 36% (faster) 00:20
Zoffix: leaving out the abs was not a mistake 00:21
Zoffix m: my $x = 1 + 28.933/60; my $y = 2 + 1.467/60; my \Δ = $x - $y; say "{Δ/$y*100}% faster" 00:22
camelia rakudo-moar e9019e: OUTPUT«-26.7842295% faster␤»
Zoffix kurahaupo, I give you "if minutes-per-run decreases by 26% (less time), then runs-per-minute increases by 36% (more runs)" 00:23
kurahaupo Zoffix: s/faster/more time/
Zoffix But "faster" is an ambiguous word here
Zoffix leaves to play Far Cry 4
timotimo have fun!
kurahaupo :-) 00:25
00:25 yqt left 00:26 ShimmerFairy joined
kurahaupo goes back to lurking for another year 00:26
sortiz \o #perl6 00:37
00:37 grondilu left 00:43 tlvb left 00:47 Actualeyes joined 00:49 cpage__ joined 00:50 cpage_ left, cpage__ is now known as cpage_ 00:51 jcallen_ is now known as jcallen 00:59 canopus left 01:01 rgrinberg joined 01:02 sufrostico left 01:05 kurahaupo left, canopus joined
dalek c: cfffec8 | (Daniel Green)++ | doc/Type/IO/Path.pod6:
IO::Path.mode doesn't belong in the timestamp section
c: 5e90e17 | (Daniel Green)++ | doc/Language/5to6-perlfunc.pod6:
Fix link in 5to6-perlfunc.pod6. AlexDaniel++
c: 0a788a8 | (Zoffix Znet)++ | doc/ (2 files):
Merge pull request #655 from MasterDuke17/IOPath_cleanup

IO::Path.mode doesn't belong in the timestamp section
01:15 kalkin-_ joined, kalkin- left
Zoffix .tell moritz I recall you mentioning to point out contributors who might use a commit bit. Here's a candidate: github.com/MasterDuke17?tab=overvi...od=monthly 01:16
yoleaux Zoffix: I'll pass your message to moritz.
01:17 telex left 01:25 telex joined 01:35 rgrinberg left 01:36 wisti joined, pRiVi joined, inokenty joined, john51 joined, gtodd joined, dg joined, jdv79 joined 01:44 kerframil left 01:53 molaf left 02:01 vendethiel- joined 02:02 vendethiel left 02:05 molaf joined 02:09 noganex_ joined 02:11 alienzj joined 02:12 noganex left
AlexDaniel Zoffix: it feels like we need shotgun: instead of bisect: :) 02:15
you can't really use bisect if something was broken/fixed several times 02:16
so why bother with bisection when you can simply run something on every commit…
let's see 02:18
bisect: class Foo { method new { self.bless: *, :foo<bar> } }.new
bisectable AlexDaniel: (2016-06-12) github.com/rakudo/rakudo/commit/4179bdc
AlexDaniel bisect: good=2016.01.1 class Foo { method new { self.bless: *, :foo<bar> } }.new 02:19
bisectable AlexDaniel: no build for such “good” revision
AlexDaniel um, fine
bisect: good=2016.02 class Foo { method new { self.bless: *, :foo<bar> } }.new
bisectable AlexDaniel: (2016-06-12) github.com/rakudo/rakudo/commit/4179bdc
AlexDaniel bisect: good=2d9202c class Foo { method new { self.bless: *, :foo<bar> } }.new 02:20
bisectable AlexDaniel: no build for such “good” revision
Zoffix That was just a measurement error. It wasn't actually broken in 2016.01
AlexDaniel ah, okay 02:21
there's still a problem though 02:22
bisect: use REPL; say 1
bisectable AlexDaniel: exit code is 1 on both starting points, bisecting by using the output
AlexDaniel: (2015-12-25) github.com/rakudo/rakudo/commit/07fecb5
AlexDaniel why!
Zoffix m: use REPL
camelia rakudo-moar e9019e: OUTPUT«===SORRY!===␤REPL is a builtin type. You can use it without loading a module.␤»
02:27 Sgeo joined 02:29 Sgeo_ left
AlexDaniel .tell psch so the reason why it points to 2015-12-25 is because it says “Could not find REPL in:” and then it prints paths… 02:30
yoleaux AlexDaniel: I'll pass your message to psch.
AlexDaniel omg SVG favicons are only supported in firefox 02:35
02:40 inokenty left
AlexDaniel bisect: EVAL “use REPL” if 1; CATCH { exit 0 if $_ ~~ /builtin/; exit 1 } 02:42
bisectable AlexDaniel: exit code on a “good” revision is 1 (which is bad), bisecting with inverted logic
AlexDaniel: (2016-03-24) github.com/rakudo/rakudo/commit/f7d1c4b
02:42 aindilis joined
AlexDaniel .tell psch You probably wanted something like this: bisect: EVAL “use REPL” if 1; CATCH { exit 1 if $_ ~~ /builtin/; exit 0 } 02:42
yoleaux AlexDaniel: I'll pass your message to psch.
AlexDaniel oops, if 1 :D 02:43
02:47 wisti left
dalek osystem: e338a9a | (Andy Weidenbaum)++ | META.list:
Add module File::Presence
osystem: d2696e9 | (Zoffix Znet)++ | META.list:
Merge pull request #225 from atweiden/file-presence

Add module File::Presence: github.com/atweiden/file-presence
02:52 aindilis left, aindilis joined, kid51 left 02:55 inokenty joined 03:06 skids joined 03:37 addison left 03:39 huggable left 03:40 huggable joined
Xliff m: say (1|2|3).type 03:42
camelia rakudo-moar e9019e: OUTPUT«Method 'type' not found for invocant of class 'Int'␤ in any at gen/moar/m-Metamodel.nqp line 3138␤ in block <unit> at <tmp> line 1␤␤»
Xliff m: say (1|2|3).^name
camelia rakudo-moar e9019e: OUTPUT«Junction␤»
Xliff AARGH!
Y'all need to warn C ppl about that!
TEttinger m: say (1 ^ 2) 03:43
camelia rakudo-moar e9019e: OUTPUT«one(1, 2)␤»
TEttinger m: say (1^2) 03:44
camelia rakudo-moar e9019e: OUTPUT«one(1, 2)␤»
TEttinger m: say (1^2^3)
camelia rakudo-moar e9019e: OUTPUT«one(1, 2, 3)␤»
TEttinger what does ^ do? not xor apparently
Zoffix TEttinger, no, it creates a one Junction 03:45
huggable, Junction
huggable Zoffix, Logical superposition of values: docs.perl6.org/type/Junction
TEttinger neat 03:46
Zoffix m: say 1 xor 2
camelia rakudo-moar e9019e: OUTPUT«1␤»
03:46 cpage_ left
Zoffix m: say 0b10001 +^ 0b111111 03:46
AlexDaniel m: say (1+^2+^3)
camelia rakudo-moar e9019e: OUTPUT«46␤»
rakudo-moar e9019e: OUTPUT«0␤»
Zoffix m: say 0b10001 xor 0b111111 03:47
camelia rakudo-moar e9019e: OUTPUT«17␤»
Zoffix expected both to give same values :S
m: say (0b10001 xor 0b111111).base: 2
camelia rakudo-moar e9019e: OUTPUT«Nil␤»
Zoffix m: say (0b10001 xor 0b111111) 03:48
camelia rakudo-moar e9019e: OUTPUT«Nil␤»
Zoffix mkay
m: say (False xor True) 03:49
camelia rakudo-moar e9019e: OUTPUT«True␤»
Zoffix (it's Boolean)
03:55 MadcapJake left
ShimmerFairy xor is lower-precedence ^^ , btw. 03:56
dalek c: 90cb587 | (Zoffix Znet)++ | doc/Language/traps.pod6:
Include bitwise ops in traps
Zoffix Doesn't seem to be documented 03:57
ShimmerFairy Zoffix: how about the other lower-prec ones, and and or? :)
Zoffix They are 03:58
ShimmerFairy weird, then.
dalek c: cad79c4 | (Zoffix Znet)++ | doc/Language/traps.pod6:
Fix typo
03:59 cooper_ joined
ShimmerFairy Zoffix: your addition on bitwise ops accidentally calls +& a boolean op, instead of ?& 04:00
dalek c: 7477803 | (Zoffix Znet)++ | doc/Language/traps.pod6:
Fix typo

Zoffix Proof that it's time to go to bed \o 04:02
ShimmerFairy o/
04:02 cooper left 04:05 cooper_ left
ugexe install perl6 module from .tar.gz archive with CURI extracting each individual file as needed with 0 perl6 dependencies: gist.github.com/ugexe/2ca5464cd440...f575ec3dac 04:09
04:11 cooper joined, cooper left, cooper joined 04:15 molaf left 04:19 cooper left, gfldex left 04:20 khw left 04:24 cpage_ joined 04:28 cooper joined 04:29 cooper left 04:43 fhorck left 04:48 cooper joined 04:53 skids left 04:57 Cabanossi left 04:59 Cabanossi joined 05:00 alienzj left 05:03 alienzj joined, sortiz left 05:07 alienzj left, alienzj joined, alienzj left, alienzj joined, alienzj left 05:22 wisti joined 05:48 telex left 05:50 wisti left, telex joined 05:52 wisti joined 05:53 wisti left 05:58 firstdayonthejob joined
moritz Zoffix: thanks, I've invited MasterDuke17 06:01
yoleaux 01:16Z <Zoffix> moritz: I recall you mentioning to point out contributors who might use a commit bit. Here's a candidate: github.com/MasterDuke17?tab=overvi...od=monthly
06:11 _mg_ joined 06:12 _mg_ left 06:18 abraxxa joined 06:22 CIAvash joined 06:25 domidumont joined 06:31 domidumont left
dalek c: 446d434 | (Matt Oates)++ | doc/Language/traps.pod6:
Change string not iterable example

This example is really bad since .flip on a string is the best way to reverse a string, so this document is really just introducing another trap for the user. I've changed it instead to sorting characters which I don't believe there is a string method for?
Ulti turns out I have a commit bit... might be worth nerfing early adopter sloths like me 06:33
AlexDaniel +1 for .sort 06:34
06:36 brrt joined 06:41 firstdayonthejob left
Woodi morning #perl6 :) 06:43
06:49 domidumont joined
Woodi finally I got to installing R2016.06. and must say that it is very paintfull to be user of something which is in fast development mode ;) that speedups just *after* the release... at least 2016.06 catched some, lizmat++ ; jnthn++ :) 06:50
06:52 domidumont left, domidumont joined
moritz is "paintful" the same as "colorful"? :-) 06:56
Woodi moritz: no :) 06:57
abraxxa Hi ;) 07:01
Woodi o/ 07:03
07:13 darutoko joined 07:18 wamba joined 07:23 araujo_ joined 07:25 araujo left 07:29 araujo_ left 07:30 brrt left 07:38 dj_goku_ joined, dj_goku_ left, dj_goku_ joined 07:39 huggable left 07:40 huggable joined
dalek sectbot: 55a10e8 | (Aleks-Daniel Jakimenko-Aleksejev)++ | bot.pl:
Allow bot name as a prefix

Given that people still try to do 「bisectable: somecodehere」, it is time to allow it.
Note that 「bisectable: bisect: somecodehere」 is still not valid. If you do that, it will run fine because “bisect:” will be treated as a Perl 6 label, but that's still misuse.
07:40 dj_goku left
dalek sectbot: 166dd5a | (Aleks-Daniel Jakimenko-Aleksejev)++ | bot.pl:
Remove debug output (oops)
07:43 bisectable left, bisectable joined
AlexDaniel bisectable: for ‘q b c d’.words -> $a, $b { }; 07:44
bisectable exit code on a “good” revision is 1 (which is bad), bisecting with inverted logic
AlexDaniel: (2016-03-01) github.com/rakudo/rakudo/commit/1b6c901
AlexDaniel ok
moritz nice! 07:48
07:49 zakharyas joined 07:57 rindolf joined 08:04 gfldex joined 08:14 g4 joined
Woodi so, in my baby-perl6 "benchmark" R*2016.04 was 24.25, R2016.05 was 23.25, same for R2016.06 and R2016.07.01 is 21.25 where 1 is some Perl5 script (a bit deoptimized with HOP...) 08:24
moritz so, the trend is good
Woodi yes, but we got long spring to recover after xmass :) 08:25
AlexDaniel in other words, 21 months to go? :) 08:27
Woodi now possibly it would be nice to look for holes/niches in "production environments"... maybe something like generating C code. or somethingsomething virtualization ? :) 08:29
AlexDaniel: you are so optimistic :)
AlexDaniel Woodi: not really, just a bit linear :) 08:30
moritz wonders why this "compiling to C" meme never dies
Woodi moritz: becouse it's close to CPU and we have kind of CPU that we have :)\ 08:31
AlexDaniel Woodi: in fact, it is 22 months till global catastrophe due to artificial intelligence
Woodi AlexDaniel: 2012 was worse perspective :)
do we Still faster then Moose ? what about comparing to other Moo'ses ? 08:33
AlexDaniel docs.perl6.org/language/faq#Is_Per..._for_me%3F 08:34
no idea
I guess that we have to run these snippets to find out :D
08:38 sno left 08:49 vendethiel joined
moritz Woodi: still, it's a fallacy. MoarVM is also written in C, so we already get the speed that C can give us 08:50
08:51 vendethiel- left, CIAvash left 08:52 AlexDaniel left 08:53 RabidGravy joined 08:54 abraxxa left
ShimmerFairy moritz: actually, I'd argue ultimately compiling to your CPU's native assembler is better than that of a VM built on top of your CPU :P 08:55
Woodi moritz: but PMCs are not native types...
moritz ShimmerFairy: but the need for the VM features doesn't go away by compiling Perl 6 to C 08:59
you still need garbage collecition, multi dispatch, named arguments and all that stuff
Woodi AlexDaniel: Mojo 2.96s; Moose 9.68; Perl6 17,36s; Moose (mutable classes) 142,92s
ShimmerFairy moritz: that feels like an overly-literal approach to what's basically source translation; you wouldn't need e.g. named arguments if my P6 script never uses them. 09:00
09:05 neuron joined
Woodi moritz: my use case is: some portal using 100 (sorry, late 90s numbers ;) ) Intel servers doing PHP apps like postcards.portal.com/news/sport/music/.... and no money to buy more servers; moust apps are same PHP code with different content. I think that if that apps will be in C it would be like 50 unused servers... 09:05
09:06 sno joined
Woodi ...so HLL is good for prototyping but when it is working it needs to be rewrited into something generating native code... 09:07
09:07 jkramer joined
jkramer Ahoy 09:07
Woodi eg. sysV init scripts was too long a "scripts" ;)
hi jkramer :)
jkramer I'm not sure if I'm doing something wrong or if I might have found a bug. I have this line: my %short-flags <== map { $_.short => $_ } <== grep { $_.short } <== @!options; 09:08
It works fine, but if I put linebreaks in front of the <=='s, I get a syntax error
About a missing '>'
09:09 bjz joined, pmurias joined
pmurias re compiling to C, why would be that better than what MoarVM is currently doing and compiling to machine code? 09:11
ShimmerFairy pmurias: the only big plus that comes to my mind is "way more portable source" (as in, someone's far more likely to have a spare gcc on hand than a spare rakudo) 09:12
pmurias: but yeah, making it somehow possible to do mbc->asm would be of comparable usefulness. 09:13
gfldex m: gist.github.com/gfldex/d083f6925f0...7817d45910
camelia rakudo-moar e9019e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in quote words; couldn't find final '>'␤ ␤at <tmp>:5␤------> 3 <== @options;7⏏5<EOL>␤ expecting any of:␤ postfix␤ quote words␤ …»
gfldex m: gist.github.com/gfldex/d083f6925f0...7817d45910 09:14
camelia rakudo-moar e9019e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Shaped variable declarations not yet implemented. Sorry. ␤at <tmp>:3␤------> 3 <== map { $_.uc =>7⏏5 $_ }\␤»
09:15 labster left
gfldex jkramer: feed operators are not propery implemented yet, the error message is LTA tho 09:15
jkramer gfldex: Ok, thanks 09:16
pmurias ShimmerFairy: the runtime is needed, so we would need to bundle up a rakudo 09:18
09:18 Actualeyes left 09:19 Actualeyes joined
ShimmerFairy pmurias: for what, the C idea? Not for a sufficiently clever translator :P 09:19
09:21 abraxxa joined
pmurias If you get someone to rewrite in program in C it likely won't need the Rakudo runtime 09:26
ShimmerFairy Well sure, humans usually count as sufficiently clever translators :) 09:28
pmurias only ones I can imagine
ShimmerFairy pmurias: I think at minimum it should dynamically link what it wants (e.g. libmoar.so). Bundling a static library into it, or otherwise forcing someone to cart around the runtime with the program, would be quite LTA.
pmurias ShimmerFairy: isn't carting around everything that's needed what people want when they package around things as an executable for linux? 09:31
ShimmerFairy pmurias: not really. Windows, yeah, but on Linux the magic is that you _don't_ have to package up all the libraries you need :) 09:32
moritz static linking and fat-packaging still has advantages on linux 09:36
Woodi pmurias: just tested: strace nqpSayA 401 syscals; strace cSayA 28...
pmurias Woodi: ? 09:37
Woodi pmurias: so execution time is 20+ times shorter... 09:38
m: say 401/28
camelia rakudo-moar e9019e: OUTPUT«14.321429␤»
Woodi ok, 14 :)
ShimmerFairy moritz: I've personally never run into a situation where that's genuinely helpful. .so's are just too nice :) 09:39
pmurias Woodi: we are not at hand written performance yet
Woodi pmurias: but it's not about us, just how things generally are... 09:40
and of coursse making C code is harder then HLL but it's why HLL is for ptototyping and then "evaluating" :)
pmurias Woodi: there is nothing forcing things to be that way 09:41
09:43 jjido_ joined
pmurias Woodi: if I wanted to waste the time I could make NQP emit hand written quality C code for hello world programs 09:44
or other stupid benchmark of the month 09:45
09:50 wamba left, wamba joined 09:55 wamba left
jkramer Another question: why does this work: my @foo = grep { ... }, @stuff; my $bar = @foo.first; But not: my $bar = first grep { ... }, @stuff ? 10:01
tbrowder morning #perl6 10:02
jkramer Oh nevermind, I get it. When called as a sub the first argument is a matcher.
Ha, that's genious actually, saves me a grep :)
tbrowder what's the policy on leaving debug code in source for at least a while? 10:03
10:08 abraxxa left
gregf_ jkramer: grep is a global function, whereas first is a method 10:14
10:14 jjido_ left, vendethiel left
gregf_ m: say ([1..10].grep: { $_ %% 3 }).first 10:15
camelia rakudo-moar e9019e: OUTPUT«3␤»
10:15 vendethiel joined
gregf_ well, there i guess, grep is a method call :| #confusing 10:16
10:17 psch_ is now known as psch
ShimmerFairy lots of things are provided in both sub and method form for convenience and preferred programming style. 10:17
pmurias tbrowder: you mean leaving in commented out debugging comment in rakudo source code? 10:20
tbrowder yes
psch tbrowder: if it's generally useful and meaningful and hidden behind an env var, i'd say go ahead
yoleaux 02:30Z <AlexDaniel> psch: so the reason why it points to 2015-12-25 is because it says “Could not find REPL in:” and then it prints paths…
02:42Z <AlexDaniel> psch: You probably wanted something like this: bisect: EVAL “use REPL” if 1; CATCH { exit 1 if $_ ~~ /builtin/; exit 0 }
10:21 jjido_ joined, kaare_ joined
tbrowder pmurias: okay, thanks, i don't want to abuse it but i'm preparing a PR that might need some retries before being accepted and might need more debugging 10:23
timotimo i've probably done it differently in the past, but it's favorable to not leave debug output around for bisectability and such. though it's probably no big deal 10:24
psch right, the big thing is that you have to work for it to come out 10:25
like, we have RAKUDO_MODULE_DEBUG around for what, a year?
but that's fine, cause without the env var it doesn't get in the way
timotimo ah, well, if you put it behind an env var, that's probably fine
i wonder if the checks for rakudo module debug are optimized at all, or if they are a performance drain
dalek c: 628efba | (Jan-Olof Hendig)++ | doc/Type/Date.pod6:
Expanded the doc for Date.Str
psch that's an interesting question, yeah 10:26
iirc $RMD is lexical everywhere its used..?
timotimo i haven't looked at all 10:28
10:28 sno left
timotimo just a random thought that came to my mind 10:28
like how if you have a benchmark with a while loop that compares an int against @*ARGS[0], it'll be a million times slower than if you .Int it once and put it into a variable, or even into a native variable 10:29
psch 41 lines with $RMD 10:30
well, two are from CUR::Perl5
the rest is PrecompRepo, World, RepoRegistry, in descent amount
timotimo descent was a great game 10:31
psch +ing
well, descending /o\
10:33 tlvb joined 10:34 abraxxa joined
nine I'm quite sure that $RMD costs some performance and I'm very much looking forward to a time when we can remove it. Will also make the code nicer. 10:35
timotimo yay 10:36
*sigh*, the thing about my virtual desktop setup is that i don't have enough virtual desktops right next to my irc/browser/jabber desktop :P
DrForr Enlightenment splits desktops per display, default of 4 each. 10:37
psch well, the naive benchmark i whipped up here is actually half a second slower without $RMD :S 10:38
timotimo i want both my displays to switch at the same time
haha, that's great :D
psch ah shucks, now i tossed a change i had been working on :| 10:39
well, not too bad
cause it also would need some design input anyway 10:40
#127924 that is
nine tossed?
psch yeah, checkout .
'cause i wanted to get rid of the comment-out-$RMD changes but forgot there was other changes around 10:41
no big deal though, it didn't really work yet anyway and i still recall what i did do :)
timotimo oof
do you know of git checkout -p ?
psch yeah
i might eventually learn to always do confirm-y stuff, but apparently not yet :) 10:42
timotimo i suppose you have to get hurt often enough in order to really build that habit :\ 10:44
psch anyway, the thing with the ticket above is, that if &return inside an 'is rw' Routine is what we have &return-rw for now, (1) is return-rw still allowed in a not-'is rw' Routine? (2) do we actually still need &return-rw if not (1)? 10:45
rt.perl.org/Public/Bug/Display.html?id=127924 # because synopsebot is on vacation apparently 10:46
10:53 TEttinger left
nine I lost an evening of playing Diablo II this week due to a git checkout . 10:54
Recovered the progress in a speedrun though :)
psch Diablo II is something i will never start playing again :P 10:55
jkramer Is there some syntax sugar to avoid having to type long namespaces/class/enum paths too often? Something like this would help: enum Foo <A B>; Need::These::Values::{A,B} 11:01
sjn \o
timotimo importing should help
jkramer I mean Need::These::Values::Foo::{A,B} of course 11:02
I'm actually in the same module
timotimo m: enum Foo::Bar::Baz <A B C>; say Foo::Bar::Baz::<A B C>.perl
camelia rakudo-moar e9019e: OUTPUT«(Foo::Bar::Baz::A, Foo::Bar::Baz::B, Foo::Bar::Baz::C)␤»
jkramer Although the enum is in a different class
Ah neat, thanks a bunch! 11:03
sjn what's the idiomatic way of sorting a hash by key (or by value, for that matter)? 11:04
psch m: my \CURI = CompUnit::Repository::Installation; say CURI.perl 11:05
camelia rakudo-moar e9019e: OUTPUT«CompUnit::Repository::Installation␤»
psch jkramer: an alternative i suppose ^^^
m: my %h = :2b, :1c, :3a; say %h.sort; say %h.sort: *.value
camelia rakudo-moar e9019e: OUTPUT«(a => 3 b => 2 c => 1)␤(c => 1 b => 2 a => 3)␤»
sjn psch: thanks! :) 11:06
11:06 jjido_ left
sjn tried with %h.sort(:value) and that didn't do anything 11:07
psch right, sort takes a positional Callable
sjn I now see the errors of may ways :)
should nonsensical parameters to sort give a warning? 11:08
ShimmerFairy not nonsensical named params to methods :D
psch no nonsensical named parameter will every give a warning
well, to methods, yes, ShimmerFairy++
ShimmerFairy (it's the ~totally sensible~ magic of *%_ that ~definitely~ deserves to be a part of P6) 11:09
11:13 jjido_ joined
sjn m: my %h = :2b, :1c, :3a; for %h.sort.kv -> $nums, $letters { say $letters }; 11:14
camelia rakudo-moar e9019e: OUTPUT«a => 3␤b => 2␤c => 1␤»
sjn doesn't .kv actually return the key?
seems it returns a pair
ShimmerFairy m: say {:2b,:1c:3a}.kv.perl
camelia rakudo-moar e9019e: OUTPUT«("a", 3, "c", 1, "b", 2).Seq␤»
ShimmerFairy m: for {:2b,:1c:3a}.kv { say $_ } 11:15
camelia rakudo-moar e9019e: OUTPUT«a␤3␤c␤1␤b␤2␤»
ShimmerFairy m: for {:2b,:1c:3a}.kv -> ($nums, $letters) { say $letters }
camelia rakudo-moar e9019e: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in block <unit> at <tmp> line 1␤␤»
ShimmerFairy m: for {:2b,:1c:3a}.kv -> $nums, $letters { say $letters }
camelia rakudo-moar e9019e: OUTPUT«3␤1␤2␤»
psch m: my %h = :2b, :1c, :3a; %h.sort.WHAT.say
camelia rakudo-moar e9019e: OUTPUT«(List)␤»
psch m: my %h = :2b, :1c, :3a; %h.sort[0].say 11:16
camelia rakudo-moar e9019e: OUTPUT«a => 3␤»
psch .kv on a List gives you ($index, $value)
ShimmerFairy psch: oh, I think I get it
yeah, that
psch .sort returns a sorted list of Pairs
ShimmerFairy sjn: I mean
psch m: my %h = :2b, :1c, :3a; for %h.sort.kv -> $, (:$key, :$value) { say "$key: $value" };
camelia rakudo-moar e9019e: OUTPUT«a: 3␤b: 2␤c: 1␤»
11:17 sno joined
sjn that looks a little cludgey.. :-( 11:17
psch sjn: well, a Hash itself cannot be sorted :)
11:17 jjido_ left
psch so the result must be something that retains order 11:17
m: my %h = :2b, :1c, :3a; for %h.sort -> (:$key, :$value) { say "$key: $value" }; 11:18
camelia rakudo-moar e9019e: OUTPUT«a: 3␤b: 2␤c: 1␤»
psch you can just drop the .kv though
sjn right
psch 'cause the k in kv is just the index anyway vOv
lizmat Woodi: I feel your pain, but some optimizations are not without risk to the ecosystem out there 11:19
Woodi: so we like to get them out just after the release, so that we have a month for fixing any ecosystem breakage 11:20
Woodi lizmat: of course, just like no software upgrades on Friday :) 11:21
sjn funny, psch's example doesn't work on my rakudo build (a few weeks old). 11:23
has there been any work on things like that lately?
psch star-m: my %h = :2b, :1c, :3a; for %h.sort -> (:$key, :$value) { say "$key: $value" };
camelia star-m 2016.04: OUTPUT«a: 3␤b: 2␤c: 1␤»
11:23 andreoss joined
psch sjn: what's your $*PERL.compiler? 11:24
sjn psch: currently under recompilation :)
psch heh :)
well, it's fine in 2016.04 and it's fine now
sjn lots of build warnings though
psch might have been something intermittenly weird, no idea
timotimo twitter.com/rpy/status/622291301002670080 <3 11:28
sjn m: my %h = :2b, :1c, :3a; for %h.sort -> (:$numbers, :$letters 11:33
camelia rakudo-moar e9019e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 033a; for %h.sort -> (:$numbers, :$letters7⏏5<EOL>␤ expecting any of:␤ constraint␤»
sjn m: my %h = :2b, :1c, :3a; for %h.sort -> (:$numbers, :$lettersmy %h = :2b, :1c, :3a; for %h.sort -> (:$numbers, :$letters
camelia rakudo-moar e9019e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3; for %h.sort -> (:$numbers, :$lettersmy7⏏5 %h = :2b, :1c, :3a; for %h.sort -> (:$n␤ expecting any of:␤ constraint␤»
11:33 jjido_ joined
sjn dammit 11:33
11:33 jjido_ left
psch sjn: that's not gonna work. (:$key, :$value) is an unpacking sub-signature 11:34
sjn m: my %h = :2b, :1c, :3a; for %h.sort -> (:$numbers, :$letters) { say "$numbers: $letters" } # should work
camelia rakudo-moar e9019e: OUTPUT«2 unexpected named arguments passed (key,value) in sub-signature␤ in block <unit> at <tmp> line 1␤␤»
psch m: (a => 1).^attributes.say
camelia rakudo-moar e9019e: OUTPUT«(Mu $!key Mu $!value)␤»
sjn hm
psch m: class A { has $.frobniz; }; with A.new(:1frobniz) -> (:$frobniz) { say $frobniz } 11:35
camelia rakudo-moar e9019e: OUTPUT«1␤»
lizmat m: my %h = :2b, :1c, :3a; for %h.sort -> (:key($numbers), :value($letters)) { say "$numbers: $letters" } # must use key/value names 11:36
camelia rakudo-moar e9019e: OUTPUT«a: 3␤b: 2␤c: 1␤»
sjn ok, so I have a hash, I'd like the pairs of them to end up in two variable I've named, and I'd like to have it done in a sorted way, so I can iterate over it
lizmat: has the way :) 11:37
lizmat sort generates Pair, Pairs attributes are "key" and "value"
hence you *must* use :key / :value
timotimo i'd describe it as "sort uses .List, which on a hash gives you a list of Pair objects"
lizmat :$key is just short for :key($key) 11:38
sjn ok
and you have to use the paranthesis around those, because we're "unpacking" the Pairs? 11:39
lizmat that's my understanding, yes
it's basically a signature
timotimo aye, the thing after -> is a signature
11:39 huggable left
timotimo if you have :$key, :$value, you expect two named arguments 11:39
when you have (:$key, :$value), you expect a single argument 11:40
and that gets unpacked
sjn right
a signature
sjn's brain is going all bendy from this 11:41
gfldex docs.perl6.org/type/Signature#Dest...Parameters <-- we even got tha doced!
sjn bendy-warpy
gfldex i wonder if we should put /type/Signature at the front page :)
sjn or wendy-barpy? o_O
timotimo :P
.oO( bendy-warpy salvetion )
sjn :) 11:43
anyhoo, thanks for the help! 11:44
DrForr waves to lizmat. *hug* 11:45
lizmat waves back to DrForr :-)
11:46 mr-foobar left 11:53 skids joined 11:55 wamba joined, skids left 11:56 AlexDaniel joined 11:58 neuron left 12:02 depy joined, iH2O joined
iH2O hello perl6ers 12:03
12:04 depy left
timotimo hey 12:04
iH2O hmm
12:06 loren joined
jkramer How can I get the message/string from a Failure without the "(HANDLED)" prefix? 12:09
timotimo m: sub test { fail "oh no" }; test().^methods.say 12:10
camelia rakudo-moar e9019e: OUTPUT«(DESTROY AT-POS AT-KEY defined handled Int Num Numeric mess sink CALL-ME FALLBACK STORE new Bool Str gist perl exception backtrace AT-POS AT-KEY BIND-POS ASSIGN-KEY STORE iterator sink unshift chrs FALLBACK gist Numeric Str BIND-KEY new ords push ASSIGN-PO…»