🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
timotimo m: sub bake(*%p) { for %p { say "cooking $_.value() $_.key()s" } }; bake :10cookies, :5donuts, :3quiches 00:02
camelia cooking 5 donutss
cooking 10 cookiess
cooking 3 quichess
00:15 pecastro left 00:24 perlbot left, simcop2387 left 00:28 ctilmes joined 00:29 ctilmes left 00:33 Sgeo left 00:49 Kaiepi left 00:54 Kaiepi joined 00:57 Cabanossi left
cpan-raku New module released to CPAN! Sparrow6 (0.0.21) by 03MELEZHIK 01:00
01:06 Cabanossi joined 01:24 marcusr left 01:26 marcusr joined 01:28 Doc_Holliwood left 01:30 guifa left, guifa_ is now known as guifa 01:55 Redfoxmoon left 01:56 Redfoxmoon joined 02:03 perlbot joined, simcop2387 joined 02:05 Manifest0 left 02:06 Manifest0 joined 02:11 aborazmeh joined, aborazmeh left, aborazmeh joined
Xliff m: say "This is my PI: π.fmt('%1.12f')" 02:14
camelia This is my PI: π.fmt('%1.12f')
Xliff m: say "This is my PI: { π.fmt('%1.12f') }"
camelia This is my PI: 3.141592653590
Xliff m: my $PI := π; say "This is my PI: $PI.fmt('%1.12f')" 02:15
camelia This is my PI: 3.141592653590
Xliff my @a = <a b c d e>; say "@a f g"
evalable6 @a f g
Xliff my @$ = <a b c d e>; say "@a f g"
m: my @a = <a b c d e>; say "@a f g"
camelia @a f g 02:16
Xliff m: my @a = <a b c d e>; say "@a[] f g"
camelia a b c d e f g
Xliff m: my @a = <a b c d e>; say "@a[1, 2] f g" 02:17
camelia b c f g
02:21 Cabanossi left 02:27 Cabanossi joined 02:42 Sgeo joined 02:55 girafe left 02:56 girafe joined 02:59 dotdotdot left 03:01 dotdotdot joined 03:34 __jrjsmrtn__ joined 03:35 jrjsmrtn left 03:36 rindolf joined 03:37 soar joined 04:08 aborazmeh left 04:11 ab5tract joined 04:22 mahafyi left 04:25 poohman left 04:32 KindTwo joined 04:33 KindOne left 04:36 KindTwo is now known as KindOne 04:48 vike1 left 04:55 stoned75 joined 05:16 MilkmanDan left, MilkmanDan joined 05:19 aborazmeh joined 05:20 aborazmeh left, aborazmeh joined 05:23 xinming left, xelxebar left, xinming joined 05:25 xelxebar joined 05:30 brtastic joined 05:35 stoned75 left 06:16 Xliff left 06:36 Doc_Holliwood joined 06:40 wamba joined
Geth doc: 02c1164d5c | (Mike Swierczek)++ | doc/Language/control.pod6
Attempt to add 'case statements' to indexing

This is just for a search convenience if someone coming from a C-style language background searches for 'case' or
  'case statements' instead of 'switch'.
06:41
doc: 70d4583308 | (Mike Swierczek)++ | doc/Language/control.pod6
Update.
linkable6 Link: docs.raku.org/language/control
doc: 5b4787e111 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/control.pod6
Merge pull request #3448 from Michael-S/add_case_keyword_ref_to_given

Attempt to add 'case statements' to indexing
doc: 7f064c7cae | (Luis F. Uceta)++ | 2 files
Clarify description of reduce sub/method for Any and List

  * Also add a few examples
Refs: #3340
06:43
doc: 9ef5e5e452 | (Luis F. Uceta)++ | 2 files
Make changes as requested
linkable6 DOC#3340 [open]: github.com/Raku/doc/issues/3340 [RFE][docs] Confusing description of reduce sub/method
doc: 0af36d0f2b | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3447 from uzluisf/master

Clarify description of reduce sub/method for Any and List
06:53 JJMerelo joined 07:23 kensanata joined 07:46 patrickb joined, soursBot joined
soar .sort: * < * 07:50
the sorted result is by descending.
It's confusing to me...
moritz soar: note that sort usually take a three-way comparison operator like <=> or cmp 07:54
hobbs soar: sort expects a callable that acts like <=> or cmp (returning -1, 0, 1 for less/same/more)
moritz if you pass it a two-way comparison operator, it's bound to behave weirdly
hobbs I think that if you give it <, it will interpret < as "more", and >= as "same" 07:55
which will get you a backwards result and/or a broken one because you're lying and telling it "same" when actually "more" :)
soar umm.... let me think of 07:56
hobbs (I'm assuming that since it doesn't crash, it interprets True as 1, and 1 as Order::More, and False as 0, and 0 as Order::Same) 07:57
soar semantic, * < *, is not valid here 07:59
how shall we say sorting by descending 08:00
hobbs .sort: { $^b <=> $^a } would be one way 08:02
or sort then reverse (I'm not sure if the optimization that replaces that with a reverse-sense sort exists in raku) 08:03
MasterDuke soar: if it's numeric data, `-*` or `+*` 08:07
m: my @a = (^4).pick(*); say @a; say @a.sort(-*); say @a.sort(+*) 08:08
camelia [3 1 2 0]
(3 2 1 0)
(0 1 2 3)
hobbs yeah, that's reasonable :) 08:09
soar thank you guys! Now I get it.
MasterDuke also, in the `(-|+)*` case it will do a schwartzian transform for you if needed 08:14
m: my @a = ("0".."9").pick(*); say @a; my @b; my $s = now; @b = @a.sort(-*) for ^50_000; say now - $s; say @b 08:15
camelia [7 2 9 0 3 4 8 6 1 5]
1.97999607
[9 8 7 6 5 4 3 2 1 0]
MasterDuke m: my @a = ("0".."9").pick(*); say @a; my @b; my $s = now; @b = @a.sort({ $^b <=> $^a }) for ^50_000; say now - $s; say @b
camelia [7 5 3 8 6 4 2 1 9 0]
2.95469545
[9 8 7 6 5 4 3 2 1 0]
08:17 aborazmeh left 08:27 xinming left 08:28 xinming joined 08:30 soursBot left 08:50 soar left 08:52 kensanata left, stoned75 joined 09:02 stoned75 left 09:04 stoned75 joined 09:05 Redfoxmoon left, Redfoxmoon joined, soar joined 09:08 estrabd joined
soar so, .sort(-*) is faster than .sort( {$^b <=> $^a}) 09:09
09:10 estrabd left 09:16 aborazmeh joined, aborazmeh left, aborazmeh joined 09:37 sena_kun joined 09:43 ab5tract left 09:44 soursBot joined 09:58 vike1 joined 10:10 Black_Ribbon left, chloekek_ joined 10:27 Altai-man_ joined 10:30 sena_kun left 10:34 Sgeo left
lizmat soar: yes, because it does a Schwartzian Transform under the hood 10:40
soar good to know it. :-) 10:44
10:56 pecastro joined 11:03 kensanata joined 11:07 soursBot left 11:11 soursBot joined 11:14 chloekek_ left 11:23 xinming left, xinming joined
xfix i'm not sure, how Schwartzian Transform is going to help with a function as simple as `-*`? 11:27
i would personally expect `{$^b <=> $^a}` to be faster
unless `<=>` is ridiculously slow 11:28
oh, right, string to integer conversion is involved 11:29
11:29 aborazmeh left
lizmat indeed :-) and by using a Schwartzian transform, that conversion would only need to be done once for each element 11:30
rather than twice for *each* comparison
11:32 kensanata left 11:44 Kaiepi left 11:48 konvertex joined 11:52 Doc_Holliwood left, Doc_Holliwood joined 11:53 andrzejku joined 12:02 soursBot left 12:05 chloekek_ joined 12:13 Kaiepi joined 12:14 andrzejku left 12:21 soursBot joined 12:24 poohman joined
poohman hi 12:24
12:26 leont__ joined 12:28 JJMerelo left, leont left, sena_kun joined
poohman m: class A { has Str $.a;has Str $.b};my A @c; @c.append(A.new(a => "1",b => "one"));for @c.append(A.new(a => "2",b => "two"));@c.grep(*.a ~~ /1/).map(*b) {.say}; 12:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3or @c.append(A.new(a => "2",b => "two"))7⏏5;@c.grep(*.a ~~ /1/).map(*b) {.say};
expecting any of:
block or pointy block
12:29 leont__ left 12:30 Altai-man_ left
poohman m: class A { has Str $.a;has Str $.b};my A @c; @c.append(A.new(a => "1",b => "one"));@c.append(A.new(a => "2",b => "two"));for @c.grep(*.a ~~ /1/).map(*b) {.say}; 12:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3=> "two"));for @c.grep(*.a ~~ /1/).map(*7⏏5b) {.say};
expec…
12:32 jhgg56565 joined, jhgg56565 left
poohman m: class A { has Str $.a;has Str $.b};my A @c; @c.append(A.new(a => "1",b => "one"));@c.append(A.new(a => "2",b => "two"));for @c.grep(*.a ~~ /1/).map(*.b) {.say}; 12:32
camelia WhateverCode object coerced to string (please use .gist or .raku to do that)
in block <unit> at <tmp> line 1
poohman could somebody please help me with the grep part of the above code 12:33
ShimmerFairy m: class A { has Str $.a;has Str $.b};my A @c; @c.append(A.new(a => "1",b => "one"));@c.append(A.new(a => "2",b => "two"));for @c.grep({$_.a ~~ /1/}).map(*.b) {.say}; 12:36
camelia one
ShimmerFairy there's a limit to how magical * can be.
poohman ah ok - I thought it was something deeper - thanks
ShimmerFairy In short, what the grep bit you wrote said wasn't {$_.a ~~ /1/} (like you wanted), but rather {$_.a} ~~ /1/ 12:38
12:38 leont joined 12:39 mowcat joined
poohman oh ok - that was not as simple as I thought 12:41
12:46 mowcat left 12:48 cyg07 joined 12:50 Doc_Holliwood left 12:53 Doc_Holliwood joined 13:00 cyg07 left 13:10 soursBot left 13:23 gdonald joined 13:27 wamba left, soursBot joined 13:31 cpan-raku left 13:33 chloekek_ left 13:39 cpan-raku joined, cpan-raku left, cpan-raku joined 13:43 aborazmeh joined, aborazmeh left, aborazmeh joined
Geth doc: uzluisf++ created pull request #3449:
Revise the Capture page
13:48
13:52 leont left 13:53 wamba joined, soursBot left
wamba !boss 13:53
14:09 Doc_Holliwood left 14:15 soursBot joined 14:27 Altai-man_ joined 14:30 sena_kun left 14:33 soursBot left 14:36 Doc_Holliwood joined 14:37 lucasb joined 14:43 rbt joined 14:45 Altai-man_ left 14:46 hazim joined 14:47 sena_kun joined 14:50 chloekek_ joined, soar left 14:52 hazim left 14:57 lichtkind joined 14:59 mahafyi joined
mahafyi moritz : good evening. I had purchased your Perl5 Fundamentals. Is there a list of new changes in the latest 'Raku' version somewhere? 15:01
lolol Perl6
15:05 poohmaan joined
moritz mahafyi: I'm working on a Raku revision right now. Basically all of the code examples still work. 15:07
mahafyi moritz : thanks :)
moritz the collation examples don't need "use experimental ..." anymore
but they work with too 15:08
15:08 poohman left
mahafyi i have been completely skipping Testing of any kind, as i couldn't get it. Going back to your book to start learning that, as i plan to actually write something for actual use other than bits and pieces of learning scripts. I have read it is important to know this from the beginning. 15:10
15:13 Doc_Holliwood left
Geth doc: 1a2cc93767 | (Luis F. Uceta)++ | doc/Type/Capture.pod6
Revise the Capture page

Refs: #3444
15:16
doc: 6cf253af53 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Capture.pod6
Merge pull request #3449 from uzluisf/master

Revise the Capture page Closes #3444
linkable6 Link: docs.raku.org/type/Capture
linkable6 DOC#3444 [closed]: github.com/Raku/doc/issues/3444 [RFE][docs] Example for Capture is confusing.
15:26 JJMerelo joined 15:30 patrickb left 16:06 lichtkind left 16:08 Doc_Holliwood joined 16:17 girafe left 16:22 rbt left, cydf joined, rbt joined 16:27 Altai-man_ joined 16:30 sena_kun left 16:43 mowcat joined 16:51 pilne joined 16:56 wamba left 16:59 mowcat left 17:07 sauvin left 17:14 sauvin joined
Geth doc: coke assigned to uzluisf Issue doc/Type/List.pod6 fails example test github.com/Raku/doc/issues/3450
cb766dd9b3 | Coke++ | xt/code.pws
17:38
17:40 vike1 left
Geth doc: JJ self-assigned doc/Type/List.pod6 fails example test github.com/Raku/doc/issues/3450
4626b05cff | (JJ Merelo)++ | doc/Type/List.pod6

Thanks, @coke, for checking this out. Closes #3450
17:49
linkable6 Link: docs.raku.org/type/List
DOC#3450 [closed]: github.com/Raku/doc/issues/3450 [docs][xt] doc/Type/List.pod6 fails example test
JJMerelo .seen [Coke] 17:52
tellable6 JJMerelo, I saw [Coke] 2020-05-29T18:40:19Z in #raku: <[Coke]> timotimo++
17:55 vike1 joined
[Coke] Hi. 17:56
17:56 Maylay left
Geth doc: 0041494085 | (JJ Merelo)++ | doc/Type/List.pod6
Fixes typo and closes #3450 again.
17:56
linkable6 Link: docs.raku.org/type/List
DOC#3450 [closed]: github.com/Raku/doc/issues/3450 [docs][xt] doc/Type/List.pod6 fails example test
JJMerelo Hi, [Coke] I was wondering if maybe we should automate example compilation and spell checks. Maybe with a GitHub action 17:57
Or even Azure pipelines. We just set it up for the Raku organization.
We could try and add some magic so that only changed files are checked 17:58
[Coke] I'm obviously 100% down for that, as I don't want to be the only runner of the tests. The original concern was: don't want to cause "build failures" when someone edited something via the web interface. Didn't want to make it burdensome for the casual contributor.
JJMerelo By the way, thanks a lot for doing that job 17:59
[Coke] JJMerelo: note that I'm already doing that magic myself with "util/update-and-test"
So please feel free to try to steal that.
17:59 Maylay joined
[Coke] JJMerelo++ 17:59
JJMerelo OK, I'll open an issue. I mean we have so much computing power at our disposal now, that why shouldn't we use it...
timotimo i just learned that someone in a book about design patterns also has a helpful section that shows what it looks like when you overuse a pattern 18:00
i wonder if our docs should have that kind of section sprinkled in every now and then
"this is what it looks like when you use hashes for everything" 18:02
JJMerelo timotimo in examples, we overuse the pattern of "look how this is written with this utterly useless example involving foo and bar" 18:03
timotimo yes
true 18:04
JJMerelo timotimo I'd definitely would go for that. So please open an issue, so that at least we take it into account.
timotimo i wish i had a better example to show 18:05
JJMerelo timotimo we probably need a "pattern" and "antipattern" page too, so that we can refer to it when we say something is overused.
timotimo or an actual reference
JJMerelo no problem, I get the idea
While making clear that we encourage that people write stuff however they want. 18:06
timotimo those "people" is for readers of the docs or writers of the docs or both?
JJMerelo Some patterns are going to be faster than others, or clearer than others
timotimo well, both... 18:07
18:07 wamba joined
JJMerelo At the end of the day, people are going ot start writing their stuff by copying-pasting from the docs and/or stackoverflow 18:07
timotimo give every single entry in the docs a little slider between "fast" and "clear" with a V somewhere in between
JJMerelo timotimo hey, not so fast (or clear). No new tooling, please... Reference examples should be clear. Tutorial examples whould show both 18:08
timotimo to make examples more useful, we should give every example a set of input boxes for "your own stuff here" 18:09
so if you have a list already and it's called "@myshinylist" it'll substitute that in the example!
JJMerelo timotimo er... no, please... no additional tooling. I'm extremely happy now that the site is fully static 18:11
timotimo ok, but even if it's static in can still be dynamic 18:12
microsoft has this shiny new technology called "DHTML"
JJMerelo timotimo maybe it would be possible with Rakudo.js Still, additional tooling to generate that stuff... Heavier pages...
timotimo essentially you write your code in VB and compile it to a .dll, then you put that into your html
sorry, i'm drifting off into silly-land
JJMerelo timotimo ... and we can import it into Raku using NativeCode :-) 18:13
timotimo Call*
JJMerelo timotimo that would be cool, but... I mean, there are other priorities. But you could submit that as a possible project for Season of Docs 18:14
We'll try again next year, I guess.
timotimo there's already an isue somewhere for giving every example a link to one of the many sites that you can run raku code on
18:15 Black_Ribbon joined
JJMerelo timotimo right... 18:15
timotimo at least some of them should be easily-ish feedable via an url parameter 18:16
otherwise we'll just™ ask for support to put an url into the url and the code would be pullde from that url
JJMerelo This is the issue github.com/Raku/doc/issues/1866 18:17
chloekek_ . 18:19
JJMerelo chloekek_ hey
chloekek_ henlo
timotimo hewwo 18:21
chloekek_ Haven’t done Raku in weeks
timotimo raku hawen't fowgotten youw 18:22
(am not actualy good at this)
chloekek_ I want to do less programming and it took me months to find something else to do 18:24
I think I want to pursue a hobby in electronics
18:24 Sgeo joined 18:25 JJMerelo left
El_Che chloekek_: isn't that just programming with soldering? :) 18:25
Grinnz it's just programming where your bugs are harder to explain 18:26
chloekek_ It’s programming but you get as much parallelism as you want.
I already had my first share of 30 minute debugging trivial issue. 18:27
Hooked up two LEDs to a 3 V battery in series. The LEDs need 2 V each. Didn’t work.
18:28 sena_kun joined 18:30 Altai-man_ left
moritz fun fact: you always need a resistor in front of a LED, even if the voltage is "right" 18:32
how unintuitive
18:33 zacts_pi joined, zacts_pi left
chloekek_ That’s because LEDs have a maximum current, and batteries and wires ideally don’t. 18:40
And the maximum means exceeding it blows it up, doesn’t limit it.
xfix some LEDs have built-in resistors, but usually you need to put a resistor in
chloekek_ Whilst waiting for new components to arrive I’m writing a Haskell library for defining circuits, and it has a function that automatically computes the necessary resistor. :) 18:41
18:48 mowcat joined 18:56 KindTwo joined 18:58 KindOne left 19:01 KindTwo is now known as KindOne, wamba left 19:02 wamba joined 19:08 wamba left 19:21 stoned75 left
tbrowder i take umbrage over criticism of too much foo, i'm lucky i can remember bar 19:23
19:23 lichtkind joined 19:24 elcaro left 19:30 elcaro joined 19:33 wamba joined 19:45 poohmaan left 19:46 schlaftier2 joined, schlaftier left, schlaftier2 is now known as schlaftier 19:49 Doc_Holliwood left 19:53 rindolf left
tbrowder i hope the implict smiley was understood :-D 19:57
lizmat
.oO( I vaguely remember a bar :-)
20:03
[Coke] m: dd $*IN.lines; 20:12
camelia ("»Wann treffen wir drei wieder zusamm?«", " »Um die siebente Stund‘, am Brückendamm.«", " »Am Mittelpfeiler.«", " »Ich lösche die Flamm.«", " »Ich mit«", "", " »Ich komme vom Norden her.«", " »Und ich vom…
20:18 chloekek_ left 20:27 Altai-man_ joined 20:30 sena_kun left 21:02 Doc_Holliwood joined 21:13 cydf left 21:17 brtastic left 21:20 xinming left 21:22 xinming joined 21:26 chloekek_ joined 21:42 xinming left 21:43 xinming joined 21:55 hyperak joined, hyperak left 22:09 HarmtH joined 22:18 wamba left 22:23 girafe joined 22:28 sena_kun joined 22:30 Altai-man_ left 22:42 chloekek_ left 22:47 aborazmeh left 22:53 maggotbrain joined 22:54 dotdotdot left 23:00 dotdotdot joined 23:03 pecastro left 23:04 aborazmeh joined, aborazmeh left, aborazmeh joined 23:23 sena_kun left 23:26 lucasb left 23:28 aborazmeh left 23:53 aborazmeh joined, aborazmeh left, aborazmeh joined 23:59 skids joined