🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:00 lichtkind_ left 00:02 reportable6 left 00:05 reportable6 joined 00:15 Zero_Dogg left, dmc00 left 00:16 dmc00 joined 00:17 Zero_Dogg joined 00:20 Geth left, Geth joined 00:27 Geth left, Geth joined 00:31 Geth left 00:32 Geth joined 00:36 Geth left, Geth joined 00:37 hankache joined 00:47 Geth left, Geth joined 00:52 Geth left, Geth joined 00:59 hankache left 01:00 Geth left 01:01 Geth joined 01:05 Geth left, Geth joined
moon-child m: say sprintf "%03s", 1.2 01:24
camelia 1.2
moon-child I want three integer digits ahead of the decimal point, regardless of what's after it. Is there a simple way of doing that? 01:25
gfldex m: say sprintf "%0fs", 1.2 01:26
camelia 1.200000s
moon-child (that is, 001.2)
gfldex m: say sprintf "%0.3f", 1.2 01:27
camelia 1.200
gfldex m: say sprintf "%3.3f", 1.2
camelia 1.200
gfldex m: say sprintf "%03f", 1.2
camelia 1.200000
gfldex m: say sprintf "%03s", 1.2 01:28
camelia 1.2
gfldex m: say sprintf "% 3s", 1.2
camelia 1.2
moon-child m: say sprintf "%03.f", 1.2
camelia 001
moon-child cool would be if you could say
gfldex m: sprintf("%03f", 1.2).say
camelia 1.200000
moon-child m: say sprintf "%03.*f", Inf, 1.2
camelia Directive %f not applicable for value of type Rat (Inf) in format
'%03.*f'
in block <unit> at <tmp> line 1
01:37 Geth left 01:38 Geth joined 01:42 Geth left, Geth joined 01:57 discord-raku-bot left 02:02 dg left 02:20 mykhal left 02:22 mykhal joined 03:22 sourceable6 left, notable6 left, nativecallable6 left, coverable6 left, greppable6 left, releasable6 left, committable6 left, shareable6 left, bloatable6 left, squashable6 left, evalable6 left, unicodable6 left, benchable6 left, reportable6 left, linkable6 left, tellable6 left, bisectable6 left, quotable6 left, statisfiable6 left, committable6 joined 03:23 linkable6 joined, reportable6 joined 03:24 unicodable6 joined, sourceable6 joined, notable6 joined, quotable6 joined, nativecallable6 joined 03:25 greppable6 joined
ggoebel m: printf "%1\$03d\b%0.2f", 1.2; 03:39
camelia 0011.20
ggoebel m: printf "%1\$03d\b\b%0.2f", 1.2;
camelia 0011.20
ggoebel the first works from the command line... 03:40
i.e. gives 001.20 03:41
moon-child ggoebel: first: that gives the wrong result for e.g. 11.2; second: I don't want something that displays like 001.2, I want the actual string 001.2
ggoebel can't figure out a clean way to get zero padding before floating point numbers 03:42
moon-child it's fine, I can build it myself; was just curious if there was a good feature built-in
ggoebel locally it prints 001.20
somethings up with whatever m: does... guessing it doesn't handle \b
moon-child the reason it displays that way is because of your terminal 03:43
and, for irc, your irc client
what I want is to generate filenames that will be ordered correctly when sorted lexicographically. So embedded backspaces do not help
ggoebel m: my $a = sprintf "%1\$03d\b%0.1f\n", 1.2; $a.say 03:44
camelia 0011.2
ggoebel guess you'll have to roll it yourself 03:45
m: 1.2 ~~ /(\d+)\.(\d+)/; my $a = sprintf "%03d.%d", $/[0,1]; $a.say; $a.chars.say; 03:53
camelia 001.2
5
04:23 evalable6 joined, bisectable6 joined 04:24 coverable6 joined 04:25 releasable6 joined, bloatable6 joined 04:29 mcmillhj joined
mcmillhj Is there a way to unpack a Pair in a block? Something like `for @pairs -> $k, $v { ... }` ? 04:30
I am sure there _is_ a way, I just can't seem to get the syntax right
moon-child hmm, ideally you would be able to say for @pairs -> ($k => $v) { ... }, but that does not seem to work 04:33
mcmillhj that was sort of what I expected to work too 04:34
moon-child could say for @pairs.map(&kv) -> $k,$v { ... }
mcmillhj okay, I'll try that. Thank you 04:43
04:59 diakopter joined 05:15 diakopter left 05:23 tellable6 joined 05:24 shareable6 joined, benchable6 joined 05:31 mcmillhj left 06:02 reportable6 left 06:04 reportable6 joined 06:23 statisfiable6 joined, squashable6 joined 07:20 seednode left, seednode joined 07:48 abraxxa joined 07:49 jjido joined 07:52 abraxxa left 07:53 abraxxa joined 08:36 Sgeo left 08:52 jjido left 08:59 dakkar joined 09:00 abraxxa left 09:03 abraxxa joined 09:39 dogbert17 left, vasko left, moon-child left, a3r0 left, greyrat_ left, Scotteh left, Zero_Dogg left, djerius left, Manifest0 left 09:45 TempIRCLogger__ left 09:46 dakkar left, statisfiable6 left, Xliff left, perlbot left, andrea[m] left, CIAvash left, sienet_ja_LSD[m] left, Kaiepi left, polettix_ left, rjbs left, rypervenche left, leah2 left, merpaderp left, dmc00 left, Colt left, Arathorn left, happy-dude left, dustinm` left, solitario left, kawaii_ left, Od1n left, Grrrr left, mathias[m] left, archenoth left, JRaspass left, jdv left, El_Che left, masak left, renormalist left, Summer left, kybr left, sftp left, silug left, ptc left, pejayes left, thowe left, sivoais left, mtj left, eof left, jast left, Ulti left, avuserow left, goblin left, mjgardner left, peder left, hexology left, corwin left, jercos left, reportable6 left, benchable6 left, shareable6 left, tellable6 left, bloatable6 left, releasable6 left, coverable6 left, bisectable6 left, evalable6 left, euandreh left, AlexDaniel left, BinGOs left, jcallen left, _________ left, zacts left, jjatria left, tobs left, sjn left, gugod left, ilogger2 left, seednode left, greppable6 left, nativecallable6 left, notable6 left, linkable6 left, committable6 left, eseyman left, samcv left, elcaro left, Altreus left, leedo left, dpk left, timo left, pjlsergeant left, ingy left, casaca left, sena_kun left, Geth left, ProperNoun left, gcd left, phogg left, Tirifto left, Util_ left, Maylay left, bdju left, moritz_ left, broquain1 left, xkr47 left, codesections left, qorg11 left, DarthGandalf left, chronon left, merryprog left, Voldenet left, abraxxa left, squashable6 left, quotable6 left, sourceable6 left, unicodable6 left, slowtyper left, amenonsen left, gabiruh left, frost left, ggoebel left, [Coke] left, vrurg left, swaggboi left, nine left, demostanis[m] left, pierrot left, Juerd left, tejr left, mykhal left, gordonfish left, tonyo left, ugexe left, jmcgnh left, jrjsmrtn left, GreaseMonkey left, tbrowder left, charsbar left, vodkra left, japhb left, gfldex left, maettu left, daxim left, zostay left, ecocode__ left, camelia left, simcop2387 left, lizmat left, synthmeat left, skaji left, SmokeMachine left, nebuchadnezzar left, oodani left, patterner_ left, leont left, PotatoGim left, Ekho left, dcx left, KotH left, rba left, ecocode left, Henry151 left, spacekookie left, esh left, tinita left 09:52 Colt left, Colt joined 09:53 Zero_Dogg joined
Geth ecosystem: JRaspass++ created pull request #598:
Fix Math::Root's branch
10:06
10:07 Geth left, Geth joined
Geth ecosystem: b805cd2663 | (James Raspass)++ (committed using GitHub Web editor) | META.list
Fix Math::Root's branch

Math::Root uses `main` rather than `master`, the fact that master works is just GitHub trying to be helpful. Unfortunately this helpfulness doesn't extend to their GraphQL API.
This change fixes gitlab.com/raku-land/raku-land/-/issues/18
10:15
ecosystem: 294d846bee | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #598 from JRaspass/patch-2

Fix Math::Root's branch
JRaspass heh when IRC tells you before email that your PR was merged :-P
10:16 Geth left, Geth joined
ggoebel m: my @pairs = :a(0), :b(1); for @pairs>>.kv.flat ->$k,$v { say "k: $k, v: $v" } 10:19
camelia k: a, v: 0
k: b, v: 1
10:29 ggoebel left
SmokeMachine m: my @pairs = :a(0), :b(1); for @pairs ->(:$key,:$value) { say "k: $key, v: $value" } 10:57
camelia k: a, v: 0
k: b, v: 1
SmokeMachine .tell mcmillhj m: my @pairs = :a(0), :b(1); for @pairs ->(:$key,:$value) { say "k: $key, v: $value" } 10:59
tellable6 SmokeMachine, I'll pass your message to mcmillhj
SmokeMachine m: my @pairs = :a(0), :b(1); for @pairs -> (:$key,:$value) { say "k: $key, v: $value" }
camelia k: a, v: 0
k: b, v: 1
11:29 evalable6 left, linkable6 left 11:31 linkable6 joined 11:38 lichtkind_ joined
lizmat clickbaits rakudoweekly.blog/2021/12/13/2021-...or-micros/ 11:44
12:02 reportable6 left 12:05 reportable6 joined 12:32 evalable6 joined 12:34 jjido joined, jjido left 12:38 squashable6 left 12:42 discord-raku-bot joined 12:46 thundergnat joined
thundergnat m: printf "%03d.%s\n", .Int, ($_ - .Int).substr(2) for 1.1443, 17.12313122, e, pi; 12:46
camelia 001.1443
017.12313122
002.7182818284590451
003.14159265358979312
thundergnat moon-child ^^^^ maybe something like this? 12:47
still would be a problem for negative numbers but could probably trap that pretty easily. 12:48
m: printf "%s%03d.%s\n", .sign < 1 ?? "-" !! "", .abs.Int, (.abs - .abs.Int).substr(2)//0 for 2, 5.1, 1.1443, 17.12313122, e, pi, -3.98 12:55
camelia 002.0
005.1
001.1443
017.12313122
002.7182818284590451
003.14159265358979312
-003.98
thundergnat or, maybe better for integers... 12:57
m: printf "%s%03d%s\n", .sign < 1 ?? "-" !! "", .abs.Int, (.abs - .abs.Int).substr(1)//"" for 2, 5.1, 1.1443, 17.12313122, e, pi, -3.98
camelia 002
005.1
001.1443
017.12313122
002.7182818284590451
003.14159265358979312
-003.98
13:09 ggoebel joined 13:48 suman joined
ggoebel SmokeMachine: very nice. didn't know you could do that 14:16
why doesn't this work?
m: my @pairs = :a(0), :b(1); for @pairs ->(:$k,:$v) { say "k: $k, v: $v" }
camelia 2 unexpected named arguments passed (value,key) in sub-signature
in block <unit> at <tmp> line 1
ggoebel guessing I'm not understanding what is going on
timo the attributes are called key and value, not k and v 14:23
ggoebel how does one introspect what attributes are present? 14:25
lizmat m: my @pairs = :a(0), :b(1); for @pairs ->(:key($k),:value($v)) { say "k: $k, v: $v" }
camelia k: a, v: 0
k: b, v: 1
lizmat m: .say for Date.^attributes 14:26
camelia int $!year
int $!month
int $!day
int $!daycount
Callable &!formatter
14:28 monkey_ joined
lizmat m: class A { has $.foo = 42 }; if A.new -> (:foo($bar)) { dd $bar } 14:28
camelia 42
ggoebel m: my @pairs = :a(0); for @pairs { .^attributes.say }
camelia (Mu $!key Mu $!value ObjAt $!WHICH)
ggoebel thank you 14:29
14:30 mcmillhj joined
Anton Antonov I made a package that downloads data over the web from some well known resources site (say, a GitHub repository.) I want to provide option for the data to be kept in the local machine. Can I use, say, the resources directory for that? I programmed a solution that does that, but I am sure it is way too hacky and ideologically wrong. Are there any documents discussing these kind of topics? (I searched for 14:32
merryprog Anton, you got cut off at "I searched for" 14:33
Anton Antonov 🙂 " (I searched for ~15 min and did not find any.)" 14:34
timo check out tha xdg spec maybe 14:37
14:39 squashable6 joined 14:47 suman left
Anton Antonov timo, Thanks! 14:52
14:55 thundergnat left 14:59 frost left 15:05 Sgeo joined
SmokeMachine m: class Bla { has $.something; has $.else }; for (Bla.new: :something($_), :else($_ * 2) for ^5) -> (:something($a), :else($b)) { say "a: $a; b: $b"} # ggoebel, not only for Pairs 15:20
camelia a: 0; b: 0
a: 1; b: 2
a: 2; b: 4
a: 3; b: 6
a: 4; b: 8
SmokeMachine it seems to be using the method to get the value: 15:29
m: class Bla { has $.a = 13; method a { 42 } }; for Bla.new xx 5 -> (:$a) { say "a: $a"}
camelia a: 42
a: 42
a: 42
a: 42
a: 42
Anton Antonov @timo Thanks again! Worked great. 15:30
timo cool!
SmokeMachine but testing if the attribute is public:
class Bla { has $!a = 13; method a { 42 } }; for Bla.new xx 5 -> (:$a) { say "a: $a"}
evalable6 Use of uninitialized value element of type Mu i…
SmokeMachine, Full output: gist.github.com/8711594aa7852d75e1...0233341509
timo the resources folder is really only for stuff you, as a module author, want to install on the user's system
SmokeMachine that seems odd to me...
15:31 ggoebel left 15:34 ggoebel joined 15:39 Geth left, Geth joined
timo it goes via method Capture 15:41
class Bla { has $!a = 13; method a { 42 } }; say Bla.new.Capture; class Bloop { has $.a = 13; method a { 99 } }; say Bloop.new.Capture
evalable6 \()
\(:a(99))
SmokeMachine timo: ok... for some reason now that makes more sense in my mind... 15:48
timo: thanks
m: 42.Capture 15:49
camelia Cannot unpack or Capture `42`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block <unit> at…
SmokeMachine m: say 42.Capture
camelia Cannot unpack or Capture `42`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in block <unit> at…
16:15 abraxxa left 16:20 abraxxa joined 16:23 MoC joined
Geth doc/codesections-isa-ok-roles: f14286b4ff | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Type/Test.pod6
State that isa-ok matches Roles

Mu.isa explicitly does *not* match roles, so it seems worth calling out that &isa-ok behaves differently.
16:25
doc: codesections++ created pull request #3997:
State that isa-ok matches Roles
16:26
16:27 Geth left, Geth joined 17:27 evalable6 left, linkable6 left 17:28 evalable6 joined 17:29 linkable6 joined 17:30 djerius_ left 17:31 djerius joined 17:38 dakkar left 17:39 abraxxa left 18:02 reportable6 left 18:40 djerius left 18:42 djerius joined 18:48 [Coke] left 18:58 [Coke] joined
Geth doc: 894ab10ecb | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Type/Test.pod6
State that isa-ok matches Roles (#3997)

Mu.isa explicitly does *not* match roles, so it seems worth calling out that &isa-ok behaves differently.
18:59
linkable6 Link: docs.raku.org/type/Test
18:59 Geth left 19:00 Geth joined, linkable6 left 19:04 Geth left, Geth joined 19:08 Geth left 19:09 Geth joined
[Coke] . 19:23
jdv codesections: around? 19:30
19:35 monkey_ left, mcmillhj left 19:40 Geth left, Geth joined 19:50 monkey_ joined 20:01 linkable6 joined 20:05 reportable6 joined 20:42 vrurg left 20:44 vrurg joined 20:57 Geth left, Geth joined 21:02 MoC left 21:23 euandreh left 21:24 patrickb joined 21:29 sena_kun left 21:31 sena_kun joined 21:48 lichtkind__ joined 21:51 lichtkind_ left 22:04 Geth left, Geth joined 22:08 ggoebel left 22:23 ggoebel joined 22:26 patrickb left 22:28 Geth left, Geth joined 22:35 ggoebel left 23:03 monkey_ left 23:18 djerius left 23:20 djerius joined 23:36 lichtkind__ left 23:52 ggoebel joined