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.
03:18 deoac left 08:11 dakkar joined 08:24 Manifest0 joined
Manifest0 Hi. I have a Distribution::Resource object, and i want to do .slurp. But it's not working. 08:42
26] > $resources<sql/env-monitoring.sql>
Distribution::Resource.new(repo => "file#/home/ux992/github/Tools/lib/Raku", repo-name => Str, dist-id => "/home/ux992/github/Tools/lib/Raku:ver<*>:auth<>:api<*>", key => "sql/env-monitoring.sql")
[27] > $resources<sql/env-monitoring.sql>.slurp
No such method 'slurp' for invocant of type 'Slip'. Did you mean
'Slip'?
is this a bug or an documentation issue? 08:43
the full path of the file: /home/ux992/github/Tools/resources/sql/env-monitoring.sql 08:53
i think it's a skill issue :-| If i create manually the Distribution:Resource object and remove the "/lib/Raku" from the paths. It works 09:00
lizmat Manifest0: you're the first person to actually manually want to create a Distribution::Resource object 11:43
that I know of: before answering your question: may I ask why ?
Manifest0 lizmat: it was just to test, what was wrong with it. I haven't still figure it out what i'm doing wrong 12:11
i have a script in bin/ that creates an object, and invokes a method .get-resource that returns the %?RESOURCES 12:13
then i'm trying to the .slurp and it's failing
with the error written above 12:14
my META6.json has "resources": ["sql/env-monitoring.sql"] 12:15
hmmm... it works on my personal pc. not on my server. Probably the installation is borked 13:20
figure it out the issue! i was exporting RAKULIB=/home/ux992/github/Tools/lib/Raku 13:42
after i unset the RAKULIB it started working as expected!
15:22 librasteve_ joined 16:39 dakkar left 16:42 arkiuat joined
arkiuat not sure what the right channel for this is, but I finally got tired of my Raku syntax highlighting making comments the same color as variables (and even worse, cyan). I had just grabbed a config that works, and it turns out to be NeoVim's default, which turns out to be github.com/Raku/vim-raku which hasn't been updated in years. All I want to do is change the color of comments, but having 16:49
dug this far (locating the files isn't easy on MacOS), I'm still perplexed
disbot4 <antononcube> @arkiuat The vi-addicts inhabit the main, IRC channel. ("raku-irc") 16:50
arkiuat okay, I'll go bug them there. Thanks!
lizmat fwiw, comments are blue for me out of the box on MacOS 16:51
disbot4 <antononcube> @arkiuat Oh, yeah -- this cartoon might prepare you for the feedback you would get: xkcd.com/386/ 16:53
arkiuat lizmat yes, I suppose it is blue and not cyan, actually I think I'd prefer cyan to blue. I'm a red/orange/green/yellow type and don't like blues in my text unless they're shouting something
lizmat but yeah, that repo could use some TLC 16:54
arkiuat antononcube, librasteve was the only one on #raku-irc when I arrived there. Did you mean the main #raku channel? 17:00
lizmat, indeed
disbot4 <antononcube> @arkiuat Like me, librasteve lives in the 21st century and uses Discord. 17:02
<librasteve> on Discord we have #raku and #raku-irc ... #raku-irc maps to the IRC #raku channel ... I have requested some clean up of the Dicord channels (including this), but have not yet found the Discord channel owner
<antononcube> The vi-addicts hang there by other means.
<antononcube> Hmm... my directions to "raku-irc" are misleading, then... 17:03
<librasteve> tries again 17:05
arkiuat discord is proprietary and even more fragmented than IRC, but it's not as if I don't run it occasionally 17:09
how do I get an invite to the Raku Discord server? 17:10
disbot4 <antononcube> There is a general invite in the main page.
<antononcube> raku.org/community/ 17:11
arkiuat okay, I'm in and looking at #info-and-rules. Thanks! 17:13
17:39 SEric joined 18:03 msiism joined
msiism Can anyone point me to a document that goes through the pros and cons of using arrays versus hashes in Raku? 18:04
disbot4 <antononcube> Seems, like an easy LLM task. 18:05
msiism Uhh… let me just try a couple more web searches then. 18:09
disbot4 <librasteve> msiism: good question - I find that thinking about my natural data structures is one of the most important software design criteria - what is coming in, what is stored and what is going out 18:29
<librasteve> in that context isis usually pretty clear when to use an Array and when a Hash - for example here is a list of Contacts, each has first-name and las -name. So each Contact will be best represented as a Hash eg with %contact1<first-name> = 'steve'; %contact1<last-name> = 'roe'; but then I want my contacts as an Array of Hashes... @contact-list = %contact1, %contact2 ... 18:34
msiism I was going to use a nested array to represent the in-memory version of little flat-file database containing Web bookmarks. 18:35
disbot4 <librasteve> that way I can eg sort my list according to eg last-name, or grep a specific contact (ir a sub list) by eg last-name and I can add eg %contact<email> later if I want to extend the model
msiism My reasonsing was that arrays are probably faster. 18:36
On the other hand, having keys instead of an index would be more comfortable. 18:38
disbot4 <librasteve> sounds cool - often I write out the first few groups of my data and see what the best fit is - could be a 2D Array ... goes without saying that you are looking for structure here ...
lizmat note that arrays also have a .keys method 18:39
m: my @a = <a b c>; dd @a.keys
disbot4 <librasteve> I think that Hash es in raku are very fast ...
camelia (0, 1, 2).Seq
lizmat straight string hashes are pretty fast, object hashes not so
disbot4 <librasteve> yeah - well string hashes covers most needs ... ;-) 18:40
msiism I was actually going to store the time of addition as an integer, ad the uuid as a hex number, potentially. 18:42
lizmat actually, most of the overhead of object hashes is caused by the effort needed to create a .WHICH
so that may vary a lot depending on the objects you put as keys in an object hash 18:43
msiism So, keys can have other types than Str? 18:45
Okay, "will be coerced to a string". 18:46
I'd only use strings there anyway.
I guess I'll just give hashes a try here and see. 18:47
disbot4 <librasteve> m: my %h = ('a', 'b' ... Inf)[^99000] Z=> (^99000); say %h<eeee>; 18:50
<Raku eval> 91394
18:52 cpli joined
lizmat m: my %a{DateTime} = DateTime.now => 42; dd %a.keys 18:52
camelia (DateTime.new(2025,7,30,20,52,30.183709144592285,:timezone(7200)),).Seq
lizmat note that the DateTime did not get stringified in that case
disbot4 <librasteve> lol 18:53
19:13 stanrifkin joined 19:14 arkiuat left 19:19 arkiuat joined 19:23 arkiuat left 19:53 arkiuat joined 19:57 arkiuat left 20:25 arkiuat joined 21:30 arkiuat left 21:42 arkiuat joined 21:47 arkiuat left 22:13 stanrifkin left 22:14 arkiuat joined 22:19 arkiuat left 22:38 arkiuat joined 22:43 arkiuat left 22:52 arkiuat joined 23:08 librasteve_ left 23:10 msiism left
arkiuat there I go mischanneling again. Anyway, being able to rely on .keys and .kv to yield indices in arrays as well as keys in hashes makes it a lot easier to try out different approaches 23:15