🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:11 bisectable6 joined 00:13 quotable6 joined 00:14 releasable6 joined, statisfiable6 joined, committable6 joined, coverable6 joined, shareable6 joined, evalable6 joined 00:15 greppable6 joined 00:42 jaguart joined 00:47 jaguart left 01:16 sourceable6 joined
tbrowder__ that checks, thanks. i think this will do what i need. 01:26
02:07 reportable6 joined 02:09 jpn left 02:18 teatwo joined 02:19 jaguart joined, teatime left 02:31 jaguart left 03:06 jpn joined 03:10 jpn left 04:10 notable6 left, linkable6 left, shareable6 left, reportable6 left, evalable6 left, nativecallable6 left, unicodable6 left, squashable6 left, statisfiable6 left, bisectable6 left, quotable6 left, benchable6 left, greppable6 left, sourceable6 left, committable6 left, coverable6 left, releasable6 left 04:11 greppable6 joined, bisectable6 joined, reportable6 joined 04:12 sourceable6 joined, committable6 joined, squashable6 joined, quotable6 joined 04:13 statisfiable6 joined 04:27 perlbot joined 04:29 simcop2387 joined 04:32 teatwo left, teatwo joined 05:13 unicodable6 joined 05:15 benchable6 joined, nativecallable6 joined, shareable6 joined 05:16 linkable6 joined 05:26 tellable6 joined 06:00 reportable6 left 06:20 jpn joined 06:30 bloatable6 joined 06:34 jpn left 06:41 TypoToni left 06:43 jpn joined 06:46 jpn left 06:48 abraxxa joined 07:03 reportable6 joined 07:19 evalable6 joined 07:21 notable6 joined, coverable6 joined, releasable6 joined 07:52 sena_kun joined, Sgeo left 08:38 lizmat_ joined 08:42 lizmat left 09:13 Geth left, lizmat joined 09:14 RakuIRCLogger left
lizmat . 09:15
09:15 lizmat_ left, Geth__ left, Geth joined 09:17 lizmat left 09:19 lizmat joined 10:19 evalable6 left, sourceable6 left, notable6 left, coverable6 left, statisfiable6 left, benchable6 left, committable6 left, linkable6 left, greppable6 left, reportable6 left, shareable6 left, bisectable6 left, bloatable6 left, quotable6 left, unicodable6 left, tellable6 left, nativecallable6 left, squashable6 left, releasable6 left, reportable6 joined, greppable6 joined, coverable6 joined, squashable6 joined, benchable6 joined 10:20 bisectable6 joined, statisfiable6 joined 10:21 committable6 joined, notable6 joined, evalable6 joined, quotable6 joined, shareable6 joined, releasable6 joined, bloatable6 joined, nativecallable6 joined, linkable6 joined 10:22 unicodable6 joined, tellable6 joined, sourceable6 joined 10:34 jpn joined 11:34 committable6 left, evalable6 left, linkable6 left, statisfiable6 left, reportable6 left, nativecallable6 left, releasable6 left, benchable6 left, coverable6 left, shareable6 left, quotable6 left, bisectable6 left, tellable6 left, squashable6 left, sourceable6 left, notable6 left, bloatable6 left, unicodable6 left, greppable6 left, coverable6 joined, notable6 joined, evalable6 joined, releasable6 joined, linkable6 joined 11:35 tellable6 joined, bloatable6 joined, statisfiable6 joined, unicodable6 joined, greppable6 joined, shareable6 joined, squashable6 joined, sourceable6 joined 11:36 committable6 joined, quotable6 joined, bisectable6 joined, benchable6 joined 11:37 nativecallable6 joined, reportable6 joined
patrickb guifa: Can you do a release of DateTime::Timezones? Latest version in uninstallable without manually preinstalling its deps. 11:53
11:58 zara joined 12:00 reportable6 left 12:02 reportable6 joined 12:05 zara left 13:05 evalable6 left, linkable6 left, evalable6 joined 13:06 linkable6 joined 13:32 CIAvash left, uzl[m] left, tadzik left, Matthew|m left 13:37 CIAvash joined 13:46 xinming left 13:47 xinming joined 13:54 Matthew|m joined, uzl[m] joined, tadzik joined 14:15 tea3po joined, tea3po left 14:16 tea3po joined 14:18 teatwo left 14:26 abraxxa left 14:27 Sgeo joined 15:27 evalable6 left 15:29 evalable6 joined 15:31 TypoToni joined
tonyo . 15:33
15:56 jpn left 16:16 Oshawott left 16:20 archenoth joined
tbrowder__ hi, i need help with hyper on a hash. the hash k 16:42
*looks like this: %h = a => [1, 2, 3, 4], b=> [2, 3, 4, ]; 16:44
i need to multiply all values by the same value, say $a = 3 16:45
i can do it on an array fine 16:46
m: my @a = 1, 2; my @b = @a >>*>> 2 16:47
camelia ( no output )
tbrowder__ m: my @a = 1, 2; my @b = @a >>*>> 2; say @b.raku 16:48
camelia [2, 4]
ugexe m: my %h = a => [1, 2, 3, 4], b=> [2, 3, 4, ]; say %h>>.map({$_ * 2}) 16:49
camelia {a => (2 4 6 8), b => (4 6 8)}
ugexe m: my %h = a => [1, 2, 3, 4], b=> [2, 3, 4, ]; say %h>>.map(* * 2)
camelia {a => (2 4 6 8), b => (4 6 8)}
tbrowder__ ugexe: thank you!
i guess i use the first form if the number of elements is not known? 16:53
m: my $mul = 3; my %a = a=>[1,2], b=>[2,3,6], c=> [1,2]; say %a>>.map({$_ * $mul}); 16:58
camelia {a => (3 6), b => (6 9 18), c => (3 6)}
ugexe both of the forms i posted are the same, one is just slightly shorter
tbrowder__ ok, thanks a lot! 16:59
[Coke] the {$_} version is a code block with the default argument, the * version is a Whatercode that generates a Callable (I think) - end result is the same, I find that the * version is much prettier, but the {$_} lets you do some more complicated logic sometimes if you need it. 17:01
but it's personal preference.
17:09 Geth left, Geth joined 18:00 reportable6 left 18:02 reportable6 joined 19:02 tellable6 left, statisfiable6 left, reportable6 left, squashable6 left, committable6 left, notable6 left, unicodable6 left, quotable6 left, sourceable6 left, evalable6 left, coverable6 left, bloatable6 left, shareable6 left 19:03 unicodable6 joined, coverable6 joined 19:04 notable6 joined, squashable6 joined, reportable6 joined, bloatable6 joined, quotable6 joined, evalable6 joined, tellable6 joined 19:05 committable6 joined, statisfiable6 joined, sourceable6 joined 19:06 shareable6 joined
tbrowder__ [Coke] got it, thnx. can you give a short demo of a more complicated use? 19:11
i guess it could probably be for something that varies the action depending on the value, such as making all values even... 19:14
20:00 euandreh left
tonyo tbrowder__: the most common `use {$_} over *` that i've experienced would be if you need the value more than once 20:10
m: (1..5).map({$_ * $_}); (1..5).map(* * *); # doesn't work 20:11
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
tonyo m: say (1..5).map({$_ * $_}); # works
camelia (1 4 9 16 25)
tonyo m: (1..5).map(* * *); # doesn't work
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
[Coke] Yup, good example. 20:23
I would also feel comfortable making the {} version cover multiple lines, whereas I think that'd be awkward with the * version 20:24
(again, that's preference. I'd probably write an explicit sub and use that if it was *that* long.
Nemokosch m: (1..6).map(* * *).say 20:39
Raku eval (2 12 30)
Nemokosch it "works", for { $^a * $^b } 20:40
21:00 evalable6 left, linkable6 left 21:01 linkable6 joined 21:03 evalable6 joined 21:46 sena_kun left
tonyo that example demonstrates how awkward it can be, also 21:53
22:03 euandreh joined
Voldenet .map(* * *) is rapidly collapsing into being useless, I'm hardly ever using non-unary form 22:14
it only works well for things like .sort 22:15
if `.map(*1 * *1)` or something similar existed, it would reduce the pain of referencing and reordering arguments 22:16
22:22 Sgeo_ joined
lizmat .map( -> $a, $b, $c { ... } ) ?? 22:23
22:25 Sgeo left
Nemokosch m: 1, 1, * + * ... * andthen .[^10].say 22:26
Raku eval (1 1 2 3 5 8 13 21 34 55)
Nemokosch the classic
Voldenet `.map({ $^a * $^a })` exists but those { } are so horrible to type in 22:29
22:31 deoac joined
guifa patrickb: that's weird, what's the dep that it doesn't like? 22:32
gfldex Voldenet: You can define input shortcuts that type ({}) and move the cursor right to the right spot. I do that with „“, looks like this in my digraph file: '""' => '„“D', 22:34
That's a ^D in there.
Voldenet I know, but input tools for editing source code are poor solution to the problem 22:35
especially when amount of ({ }) starts to obfuscate the problem 22:37
22:40 Xliff joined
gfldex I like to use @a».&{ $^a * $^b } . 22:40
Xliff \o
tellable6 2023-04-30T23:55:36Z #raku <tbrowder__> Xliff see cpan Astro::MoonPhase; that's the source (last update 2007), then manipulated it to my needs into a json format
Xliff If I have this in Perl5: "use DBI::Log file => "~/querylog.sql";" -- How would I invoke this in Raku for Inline::Perl5?
Voldenet perhaps `use DBI::Log:from<Perl5> file => "~/querylog.sql"` would work 22:44
Xliff .tell tbrowder LOL! thanks for the pointer. I might use it. This comes after I had already written a NativeCall based module for Raku! Maybe you could help me with the release? Email: [email@hidden.address] 22:45
.tell tbrowder LOL! thanks for the pointer. I might use it. This comes after I had already written a NativeCall based module for Raku! Maybe you could help me with the release? Email: clifton.wood@gmail.com
tellable6 Xliff, I'll pass your message to tbrowder__
Xliff What about "use DBI::Log trace => 1file => "~/querylog.sql";"
Actually... 22:46
use DBI::Log trace => 1 file => "~/querylog.sql";
Aaand... no dice -- Error while importing from 'DBI::Log': no such tag 'trace' 22:47
Voldenet it appears to me that hashes should be made references automatically in the context of use as well
maybe this: use DBI::Log:from<Perl5> { :trace(1) :file("~/querylog.sql") }
Xliff Odd... same deal 22:48
Voldenet probably :trace gets attached to `use` instead of being used as hash 22:49
Xliff This one didn't spawn errors, but that was a golf...
 raku -e 'use Inline::Perl5; use DBI::Log:from<Perl5> qw<:trace, :file("a")>'
I'll have to test that one in the app. Thanks.
Voldenet you could also do `my $p5 = Inline::Perl5.new; $p5.use('DBI::Log', { whatever hash });` 22:53
I'm not sure if that would work 22:54
Xliff The one that actually did... 23:00
raku -e 'use Inline::Perl5; use DBI::Log:from<Perl5> <:trace, :file("a")>'
Thanks for your help, Voldenet++ 23:01
guifa patrickb: I just did a `zef uninstall DateTime::Timezones` and `zef uninstall Timezones::ZoneInfo` and then `zef install DateTime::Timezones` and it worked without problem. Can you send me the error message you're getting? 23:07
23:40 linkable6 left, evalable6 left, linkable6 joined 23:42 evalable6 joined