🦋 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.
stevied if I have a grammar that's been used to parse some text and then I save the Match object it returns, is there a way to run actions on the Match object later? 04:46
moritz nothing built-in, I think. You could always write your own code that recurses into the match object and calls methods corresponding to named captures though 05:13
stevied yeah, thought of that. was hoping to save myself some trouble. ok, thanks. 05:14
zacts can raku include python libraries in any way? 05:39
Voldenet Inline::Python 05:40
zacts thanks
I'll check it out (I was just curious)
Voldenet stevied#8273: not sure if that's the correct way, but you can try this ix.io/3Ufx 05:58
it assumes that whatever's captured is immutable for actions use 06:01
Voldenet …which isn't always true 06:05
Geth doc/search-categories-update: 1ec1dc3df7 | Altai-man++ | 8 files
Categorize new refs
09:32
Xliff \o 09:36
I would love to attempt some graphviz bindings for Raku, particularly for directed graph generation. However I've looked at the header files for the projects, and have no idea where to start. 09:37
Is anyone out there familiar with Graphviz who wouldn't mind at least giving me some starter tips? 09:38
moritz I think you can generate text files and pipe that to the binaries, no need for a C-level integration
Xliff I'm looking here for a start: github.com/kvdz/vala-libgvc/blob/m...ibgvc.vapi 09:39
However I'm not at all THAT familiar with Vala.
moritz: Yeah, I thought about that. My experience is with NativeCall. If I were more familiar with GraphViz as a whole, I'd do it that way.
However, I am not. So I'd thought I'd approach this like I have my other projects. Rat her than learn GraphViz, I'd like to build a Raku-ish API and learn that. 09:41
moritz not being very familiar with graphviz won't help with the C bindings
Xliff Yes, but I wouldn't have to learn GraphViz's particular syntax to use it.
I'd rather work with classes and data than syntax.
Even if it takes longer. 09:42
moritz well, I've given my advice, which you have asked for. Cannot do more.
Xliff And I thank you for what was offered.
Xliff Is CStruct mature enough to handle bitfields? 09:45
Ala something like " unsigned objtype:2;" ?
Voldenet no 10:04
while that wasn't the aim of nativecall, in a lot of cases it's easier to use tiny wrappers because of all edge cases 10:07
moon-child if you don't want to be too portable, can do the bitfield layout yourself 10:18
Voldenet m: now.DateTime.later(:4hours :5minutes).say 10:33
camelia More than one time unit supplied. Please provide these as a List of
Pairs to indicate order of application if this is intended.
in block <unit> at <tmp> line 1
Voldenet m: now.DateTime.later(:4hours).later(:5minutes).say
camelia 2022-04-04T14:38:38.250323Z
Voldenet that's some weird limitation
lizmat Voldenet: the problem is that named arguments do not have an order, and with some units, the order of application is important 10:36
moon-child m: now.DateTime.later((:4hours, :5minutes)).say 10:36
camelia 2022-04-04T14:41:25.394188Z
Geth doc: 0354ba33ed | (Luca Ferrari)++ | doc/Type/Metamodel/Trusting.pod6
Fix Metamodel::Trusting example output.

Tested against Rakudeo 2022.03
11:27
linkable6 Link: docs.raku.org/type/Metamodel::Trusting
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/04/04/2022-...completer/ 12:45
Geth doc/search-categories-update: 4013839e36 | Coke++ | xt/search-categories.t
make test executable
13:44
dutchie is there a way to have something like Z but which repeats a shorter list instead of ending iteration? 13:48
lizmat m: my @a = <a b c d>; my @b = 1,2,3; dd @a <<=><< @b 13:51
camelia [:a(1), :b(2), :c(3)]
lizmat dutchie use of hyper ops: docs.raku.org/language/operators#i..._operators
ah, repeats!
m: my @a = <a b c d>; my @b = 1,2,3; dd @a <<=>>> @b 13:52
camelia [:a(1), :b(2), :c(3), :d(1)]
dutchie ah perfect
thank you!
moon-child <<=><< looks like a fish 13:53
lizmat m: my @a = <a b c d>; my @b = 1,2,3; dd @a «=>» @b # better ? 13:55
camelia [:a(1), :b(2), :c(3), :d(1)]
melezhik . 14:27
lizmat thanks for mentioning SparkyCI in RW, the work in progress, I think I will able to deliver MVP soon 14:28
lizmat you're welcome!
El_Che melezhik: a Maximun Viable Product? 15:51
lizmat
.oO( El_Che always going for maximal effect :-)
15:54
El_Che My parents tried to call me Máximo, but I protested in Morse in the womb 15:56
melezhik El_Che - yes )) 16:00
El_Che \o/
melezhik oh, sorry - minimal valuable product actually ))
but someone might consider this as a MAXIMUM for this stage ha-ha )) 16:01
I always apply maximum efforts to deliver minimum valuable product )))
El_Che melezhik: as long as you tried! 16:06
melezhik El_Che - yes ))
Juerd lizmat: Thanks for the warm welcome in the weekly :). I'm not sure one could say I'm "back", though, as I have very few spoons to spare and am still using Raku only sometimes for quick and dirty scripts. 16:09
I find myself using Perl most of the time because I'm most proficient in that, but some problems are much easier to solve when you have types, multisubs, and some included batteries, and that's when I pick Raku instead. 16:10
lizmat Juerd++ nonetheless :-)
Juerd Especially when I need datetimes, I'll pick Raku for my quick one-off scripts :)
Especially when I need datetimes, I'll pick Raku for my quick one-off scripts :) 16:11
(Wanting List[*DateTime] is really what I ran into just before writing that reddit post, but I tend to use Int in examples because that happens more often :))
(And it happened to coincide with someone displaying a similar issue on IRC, which reminded me that I'm not the only one who has these issues) 16:12
lizmat you're not alone, indeed :-) 16:14
for the various use cases, I've created e.g. raku.land/zef:lizmat/Rake and raku.land/zef:lizmat/ValueList
Altreus Heh, I literally chose raku for a script this week because its datetime stuff is actually not awful 16:19
Juerd lizmat: I'll look at those soon :) 16:31
Geth doc: patrickbkr++ created pull request #4047:
Largely rework the Object Tutorial 2nd try
16:32
leont I do rather recognize the problem with typed arrays not being smooth. In some situations they DWIM and in some don't, and it's not intuitive at all when that happens 17:40
And it greatly annoys me, because I prefer my modules to be rather typed
Altreus I find Raku vacillates between DWIM and DWTF quite a lot 17:43
Geth raku.org: 27336b4dcf | (Roman Baumer)++ (committed using GitHub Web editor) | fetch-recent-blog-posts.pl
fix deprecated success method in Mojo::Transaction and replace with error method
17:46
Geth raku.org: 86446dded5 | (Roman Baumer)++ (committed using GitHub Web editor) | fetch-recent-blog-posts.pl
remove unnecessary semicolon
18:02
leont IMO it mostly DWIMs where it does a copy, and doesn't where it does a bind, but the latter is more common 18:48
s/IMO/IME/
Geth raku.org: cbeaeb5a9b | (Roman Baumer)++ | 3 files
change pl6anet.org -> planet.raku.org
19:39
raku.org: 9250062555 | (Roman Baumer)++ | fetch-recent-blog-posts.pl
fix deprecated slice in Mojo::Collection for fetch-recent-blog-posts.pl
Juerd leont: Feel free to chime in in the reddit discussion 19:51
I'm kinda ignoring most replies because they go into theoretical "the way things should be" discussions that I'm not that interested in as it is a purely practical issue we run into that might just not fit into a rigid system. 19:52
leont I need to assemble my thoughts first. But the coercion type suggestion sounded sensible to me 19:54
Juerd I didn't understand that one :) 19:55
Juerd And I wonder if "coercion" would mean lossiness, as in sub foo(Int() $x) { ... }; foo(4.5); 19:56
Because that's what I would really *not* want.
leont Basically, it means that an Array[Mu] is taken as input and converted into an Array[Int]
lizmat m: my Int() @a = "42","666",45.3; dd @a # don't we have that already ? 20:05
camelia Array[Int(Any) @a = Array[Int(Any)].new(42, 666, 45)
leont m: sub foo(Int() @foo) { }; foo([1, 2]) 20:08
camelia Type check failed in binding to parameter '@foo'; expected Positional[Int(Any)] but got Array ([1, 2])
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
leont Adding an is copy doesn't fix that either 20:09
lizmat m: m: sub foo(Int() @foo) { }; foo(Array[Int()].new(1, 2)) 20:13
camelia ( no output )
lizmat in the signature you're asking for an array with an Int() constraint
[1,2] is not that
leont I know that, but I want it to convert that Array to an Array[Int] 20:14
lizmat ok... as long as that is clear :-)
I have no solution
afk&
melezhik . 20:19
drakonis how does operator precedence get defined? 21:24
moon-child m: sub infix:<xxx>(\x, \y) is tighter('+') {} #drakonis 21:26
camelia ( no output )
moon-child (also 'is looser', 'is equiv')
moon-child (for builtin operators, it's somewhat more convoluted, probably for bootstrapping reasons. I assume you want to know about defining your own) 21:26
drakonis indeed
i also wanted to look into how the builtin operators do it
~for science~
moon-child look at Grammar.nqp and precedence.pm6 21:27
drakonis cool.
drakonis neat. 21:32
drakonis now, how does one declare metaoperators? 21:50
moon-child can't
yet
drakonis hm, i see.
looking forward to that day 21:51
its going to be a good day for writing cryptic code :v
hopefully rakuast will be what's needed for that 21:59
Geth Raku-Steering-Council/main: 49c01f31eb | (Geoffrey Broadwell)++ | minutes/20220402.md
Add RSC meeting minutes for 2022-04-02
22:40
melezhik .tell p6steve I've added some very simple API to manage repos in sparkci, you can check it out if you want, please take it easy and try not to add too many repos, as you are going  to break my bank, he-he ))) 23:14
current version has limitation as it expects `main` branch not `master` for GH repo
^^ patrickb as well 23:15