🦋 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.
sienet_ja_LSD[m] rakubrew just built raku + moarvm on my openbsd 7.0 just fine, I don't know why it didn't work last time I tried 00:21
El_Che \o/ 10:01
mscha m: my $s = 'abcde'; my $m = $s.match(/c/), say $m.from; say $m.to; say $s.substr($m.from .. $m.to); 12:51
camelia 2
3
cd
mscha Isn't this wrong?  The doc says: method to() 12:52
Returns the index of the end position of the match.
docs.raku.org/type/Match#method_to
CIAvash mscha: `.to` is where match ended. And where it might [continue](docs.raku.org/language/regexes#Continue). Also see design.raku.org/S05.html#line_3098 where it mentions `$/.chars` is `$/.to - $/.from`. 13:47
mscha CIAvash: well, then the documentation is wrong.  Issue submitted. 14:06
github.com/Raku/doc/issues/4000
CIAvash if you think of the end position as `$/.pos`, it is correct 14:42
guifa lizmat: ty for the DateTime is DateTime + CORE::DateTime trick, so far that I can tell it's cleaned up my code a good bit 15:27
MasterDuke mscha: this is the implementation of `substr(Range)`, maybe there's a bug you can spot? github.com/rakudo/rakudo/blob/mast...3487-L3502 17:13
CIAvash no it's correct, it needs to be written as `$s.substr($m.from ..^ $m.to)`, because `$m.to` is the last position of the match 18:08
m: my $s = 'abc'; my $m = $s.match(/ { $/.pos.say } c /) 18:09
camelia 0
1
2
CIAvash m: my $s = 'abc'; my $m = $s.match(/ c { $/.pos.say } /) 18:09
camelia 3
Guest1254 Urgent: "Raku track at FOSDEM needs more talks" 18:54
www.reddit.com/r/rakulang/comments...ore_talks/
Anton Antonov Where the talks can be submitted? 18:58
Meaning, should it be done through the FOSDEM22 system or someone from "the Raku team" have to be emailed? 18:59
lizmat Anton Antonov: ideally you should get a login on pentabarf 19:04
if that is troublesome, you could let me know a gist of what you want to do, and I'll try to enter it on your behalf
Anton Antonov lizmat: Thank you for the clarification! I was preparing for JJ Merelo efforts in "Advent of Code" an article on "Data wrangling with Raku." I am terribly late with article, but it might become a good talk. 19:12
lizmat it could well be both :-) 19:12
Anton Antonov Ah! Ok, I will try to finish this weekend then... 19:14
lizmat: Also, thank you for implementing the terribly needed and useful `Acme::Text::UpsideDown` !!
lizmat had forgotten all about it :-) 19:15
Anton Antonov Well, I submitted and issue I have on GitHub... 19:16
Well, I submitted an issue I have on GitHub...
lizmat yeah, saw that, will get to it soon 19:23
Anton Antonov lizmat: Here is the abstract of "Data wrangling with Raku": In this document we demonstrate and explain different data wrangling techniques in Raku using a specially made system of packages. We start with a general discussion on data wrangling's place in data science and why that influenced the choice of data structures that are easily interpreted in tabular data format and, the same time, natively repre 19:29
tonyo lizmat: orgs is now in fez
i'll do a write up on how to use it
lizmat tonyo: thanks!
tonyo but in the meantime the commands are in fez and the gist of roles are `admin|member`, admin can add/remove users and modify the role, members cannot. both can upload 19:30
Anton Antonov lizmat: I will make a dedicated GitHub page for that presentation / document later today.
lizmat Anton Antonov: looking forward to int 19:31
tonyo: probably won't have time to look at it today, but will do so tomorrow
Anton Antonov lizmat: Thank you! (It is encouraging...) 19:32
lizmat :-)
Anton Antonov I got interested recently in the macOS and iOS app called Siri Shortcuts. I am interested in utilizing it with Raku. I can call scripts from Shortcuts, so in principle Raku scripts should be easy to invoke. But Shortcuts also uses a a protocol called "x-callback-url" -- see (x-callback-url.com) -- which allows queries like this: `targetapp://x-callback-url/updateStatus?x-source=SourceApp&text=[Us 20:01
Or probably some Raku solutions for this already exist, I just don't know how to find them... 20:01
I got interested recently in the macOS and iOS app called Siri Shortcuts. I am interested in utilizing it with Raku. I can call scripts from Shortcuts, so in principle Raku scripts should be easy to invoke. But Shortcuts also uses a a protocol called "x-callback-url" -- see (x-callback-url.com) -- which allows queries like this: `targetapp://x-callback-url/updateStatus?x-source=SourceApp&text=[Us 20:02
mcmillhj m: sub bits-to-int(Int @bits) { :2(@bits.join(''); } say bits-to-int([0, 1, 1, 0]); 20:03
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> -to-int(Int @bits) { :2(@bits.join(''); ⏏} say bits-t…
tellable6 2021-12-14T10:59:15Z #raku <SmokeMachine> mcmillhj m: my @pairs = :a(0), :b(1); for @pairs ->(:$key,:$value) { say "k: $key, v: $value" }
mcmillhj m: sub bits-to-int(Int @bits) { :2(@bits.join('')); } say bits-to-int([0, 1, 1, 0]);
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> o-int(Int @bits) { :2(@bits.join('')); }⏏ say bits-to-int([0, 1, 1, 0]);
expecting any of:
infix
mcmillhj m: sub bits-to-int(Int @bits) { :2(@bits.join("")); }; say bits-to-int([0, 1, 1, 0]); 20:04
camelia Type check failed in binding to parameter '@bits'; expected Positional[Int] but got Array ([0, 1, 1, 0])
in sub bits-to-int at <tmp> line 1
in block <unit> at <tmp> line 1
mcmillhj ^ what's the correct way to type bits-to-int above? I always seem to struggle with Array types in Raku 20:05
lizmat m: sub a(@a where .all ~~ Int) { dd }; a (1,2,3) # mcmillhj 20:08
camelia sub a(@a where { ... })
mcmillhj oh okay, I thought since Array implemented Positional it would work the other way. Or also with `Array[Int] $bits`. 20:09
p6steve show_names_on_join off 20:20
m: sub a(@a where .all ~~ Int) { dd }; a (1,2,3) 20:22
camelia sub a(@a where { ... })