This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:53
jaguart left
01:13
jaguart joined
01:29
deoac left
01:38
razetime joined
02:42
Kaiepi left
04:25
Kaiepi joined
06:50
razetime left
07:16
razetime joined
08:03
razetime left
12:11
razetime joined
12:23
Kaiepi left
13:03
Kaiepi joined
|
|||
Anton Antonov | Is it possible to "reload" a package in a Raku session? (For example, I have a new version of the package I want to use but I do not want to quit the session.) | 15:11 | |
15:31
Heptite joined
|
|||
lizmat | I don't think so, currently | 15:55 | |
Anton Antonov | @lizmat Ok, good to know. | 16:06 | |
Is there an opposite of `pairup`? Some function converts a pair into a list or slip. | 16:44 | ||
Nemokosch | kv? | ||
Anton Antonov | Hmm... yeah. I think I tried that ... | 16:45 | |
Nemokosch | and? 😄 | ||
I also tried that and it does that | |||
Anton Antonov | Ok. This is the data structure I have: | 16:47 | |
``` | |||
$obj=$["2" => {"NChars.elems" => 9185, "NChars.max" => 695, "NChars.mean" \ | |||
=> <48533/835>, "NChars.median" => 50.0, "NChars.min" => 1, \ | |||
"NChars.sd" => 47.15582900463849e0}, "6" => {"NChars.elems" => 6467, \ | |||
"NChars.max" => 413, "NChars.mean" => <388109/6467>, "NChars.median" \ | |||
=> 52.0, "NChars.min" => 1, "NChars.sd" => 47.11089565189994e0}, "7" \ | |||
=> {"NChars.elems" => 6356, "NChars.max" => 539, "NChars.mean" => \ | |||
<56209/908>, "NChars.median" => 52.0, "NChars.min" => 1, "NChars.sd" \ | |||
=> 51.88168307308139e0}, "1" => {"NChars.elems" => 8047, "NChars.max" \ | |||
=> 450, "NChars.mean" => <475485/8047>, "NChars.median" => 50.0, \ | |||
"NChars.min" => 1, "NChars.sd" => 49.588402810696e0}, "3" => \ | |||
{"NChars.elems" => 7457, "NChars.max" => 434, "NChars.mean" => \ | |||
<447425/7457>, "NChars.median" => 53.0, "NChars.min" => 1, \ | |||
"NChars.sd" => 46.58161354817983e0}, "4" => {"NChars.elems" => 8493, \ | |||
"NChars.max" => 545, "NChars.mean" => <500896/8493>, "NChars.median" \ | |||
=> 52.0, "NChars.min" => 1, "NChars.sd" => 46.53129096684931e0}, "5" \ | |||
=> {"NChars.elems" => 8450, "NChars.max" => 453, "NChars.mean" => \ | |||
<496863/8450>, "NChars.median" => 50.0, "NChars.min" => 1, \ | |||
"NChars.sd" => 47.972282676556034e0}] | |||
``` | |||
Nemokosch | "list of pairs" is not really an established data structure imo | ||
Map is | |||
Anton Antonov | The commands `$obj.kv` does not produce a list of lists for me. | ||
Nemokosch | so you could convert to Map | 16:48 | |
or just map to kv | |||
it's also a question if you want the output to be flat or not | 16:49 | ||
Map.kv produces flat output | |||
if you map your list with &kv, that will produce nested output | |||
Anton Antonov | Yeah, what you suggest works, but I have to add `.rotor(2)`. Meaning: `$obj4.Map.kv.rotor(2)` . | 16:53 | |
But, instead I can "just" write `‌‌$obj4.map({ ($_.key, $_.value) })` -- that is what what I was doing up to now. I am not sure which of the two options is better. The second seems more obvious to me. (For now...) | 16:55 | ||
Nemokosch | .map(*.kv) ? | ||
or even .map(&kv) | 16:56 | ||
Anton Antonov | <@297037173541175296> That last on is good -- but breaks my ZMQ connections!! 😡 Thanks! | 16:57 | |
<@297037173541175296> That last one is good -- but breaks my ZMQ connections!! 😡 Thanks! | 16:58 | ||
Nemokosch | what is ZMQ again, good sir? | 17:00 | |
Anton Antonov | See zeromq.org -- I use ZMQ to connect Raku to Mathematica and vice versa. (Same with Jupyter.) | 17:02 | |
No, ZMQ breaking was caused by something else. Meaning, all your suggestions work for me. | 17:04 | ||
Nemokosch | 🥳 | ||
17:05
ToddAndMargo left
17:33
razetime left
17:59
Heptite left
19:04
Heptite joined
19:19
n1to joined
19:34
Kaipei joined
19:38
Kaiepi left
19:45
n1to left
22:36
Kaipei left
22:47
jgaz joined
22:53
Heptite left
23:16
jgaz left
|