🦋 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.
00:05 [Coke]_ left 00:07 [Coke] joined 00:15 zacts left 00:17 lichtkind_ left 01:28 ShaneC left 02:52 melezhik joined
melezhik Hi! 02:52
I've started to experiment with Sparky and built simple CI service for Raku modules - sparrowhub.io:2222
no promises to future development, doing it just for fun, at least now 02:53
in comparison with well known services like travis/ado/GH action, it provides test coverage html page
02:54 kj4tip joined
melezhik built by App::RaCoCo 02:54
sparrowhub.io:2222/about is roadmap or current state
I'd appreciate any thoughts what could be useful specifically for Raku modules CI 02:55
if people are interested to test their modules - please let me know or create issues on respected GH project page 02:56
right service watches change on the respected SCM repositories (Config::BINDish only now) and triggers a new build in case any changes 03:00
right -> right now
03:00 melezhik left 03:01 melezhik joined
melezhik build jobs gets run isolated docker containers which removed afterwords, so it's pretty secure 03:02
03:02 melezhik left 04:12 zacts joined 04:28 zacts left 05:14 jmcgnh left 05:21 jmcgnh joined 05:59 eseyman left 06:19 mexen joined 06:23 eseyman joined 06:38 euandreh left 06:56 Sgeo left 07:06 euandreh joined 07:09 dakkar joined 07:16 jjido joined 07:26 Summer left, Summer joined 07:57 jjido left 08:05 Manifest0 left, jjido joined 08:09 Manifest0 joined 08:19 jjido left 08:38 abraxxa joined 09:09 abraxxa left 09:16 abraxxa joined 10:01 sena_kun left 10:02 sena_kun joined 10:57 Altai-man joined 11:12 abraxxa left, abraxxa joined 11:47 razetime joined
sjn is at the German Perl Workshop, and lichtkind's talk about plotting with Raku starts soon (14:50 CET) 12:21
12:45 razetime left
Nemokosch so that's a thing? 😮 12:49
13:00 razetime joined 13:15 xinming left 13:28 xinming joined
p6steve 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 14:03
dang did it gain
naughty fingers
14:04 xinming left 14:05 jgaz joined 14:07 jgaz left 14:08 Sgeo joined 14:11 xinming joined
p6steve I have two similar Classes in sister packages - Dan::Series, Dan::Pandas::Series ... if I make a coercion method Dan::Series { Dan::Series.new(...) } for the latter, then I get "Cannot dispatch to method Series on Dan because it is not inherited or done by Dan::Pandas::Series" 14:37
14:37 rypervenche joined
p6steve question - do I just name it something like method Dan-Series{...} and drop the convention that Coercion methods are named after the target type? 14:38
-or- is there some other convention / idiom?
[Coke] I think in core, all the coercions are simple names, not :: separated, so we avoid this issue 14:41
p6steve Coke: tx! that's what I suspected... 14:46
Coke: tx! that's what I suspected... 14:47
Coke: (that's the first time I have asked a question that raku didn't already have an answer!) 14:48
I propose a new idiom the double dash: Dan--Series ;-) 14:49
[Coke] you can call it whatever you want if you explicitly coerce, but if you're using the coercion syntax, I don't know how you'd make that work with A::B 14:54
p6steve scrub that ... double dash is not permitted
14:55 Altai-man left 15:06 razetime left
p6steve Coke: seriously, the coercion syntax would be quite useful eg. sub( Dan::Series(Dan::Pandas::Series) $se ) {...} to force an uplift to the raku 'native' variant of Series 15:07
[Coke] Docs say "name". let me check something. 15:12
m: class Dan::Series {}; my $a = Dan::Series.new; say $a.^name; 15:13
camelia Dan::Series
[Coke] m: class Dan::Series {}; my $a = Dan::Series.new; say $a.WHAT
camelia (Series)
15:14 razetime joined
[Coke] class Dan::Series {}; class Other { method Dan::Series($x) { dd $x } }; my $meth = "Dan::Series"; Other.new."$meth"("hi there"); 15:16
m: class Dan::Series {}; class Other { method Dan::Series($x) { dd $x } }; my $meth = "Dan::Series"; Other.new."$meth"("hi there");
camelia "hi there"
[Coke] ^^ you can have a method named that, I assume it was the invocation that was giving you trouble.
15:28 vrurg_ joined 15:31 abraxxa left, vrurg left 15:38 dakkar left 15:43 razetime left 16:02 razetime joined
p6steve Coke: good point - the "Cannot dispatch to method Series" part of the error suggests that too (eg. the method name already cut down)... 16:03
m: class Dan::Series {}; class Other { method Dan::Series($x) { dd $x } };class Yetta { method cando( Dan::Series(Other) $y ) { dd $y } }; Yetta.cando( Dan::Series.new ); 16:09
camelia Dan::Series.new
p6steve m: class Dan::Series {}; class Other { method Dan::Series($x) { dd $x } };class Yetta { method cando( Dan::Series(Other) $y ) { dd $y } }; Yetta.cando( Other.new );
camelia Too few positionals passed; expected 2 arguments but got 1
in method Dan::Series at <tmp> line 1
in method cando at <tmp> line 1
in block <unit> at <tmp> line 1
p6steve ^^ I **think** this means that even if you can have :: in a method name, the coercion syntax will not work 16:11
tbrowder howdy 16:26
16:29 p6steve left 16:31 p6steve joined
[Coke] p6steve: might be a way to do it explicitly with the meta object protocol. 16:36
16:36 p6steve left
[Coke] (that is, construct the signature by hand rather than with syntax) 16:36
16:37 p6steve joined 16:38 jjido joined
[Coke] might also be worth opening a ticket to see if someone can get that syntax to work. 16:39
16:42 p6steve left 16:43 p6steve joined
guifa do you get the same issue when you use the vrurg++ COERCE route? 16:43
16:47 p6steve left 16:48 abraxxa joined 16:49 p6steve joined 16:53 She left 16:57 p6steve left 16:58 p6steve joined 17:02 p6steve left 17:03 razetime left 17:04 p6steve joined 17:08 p6steve left 17:10 p6steve joined 17:14 p6steve left 17:15 p6steve joined 17:20 p6steve left 17:21 p6steve joined 17:25 guifa left, p6steve left 17:26 abraxxa left 17:27 p6steve joined 17:31 p6steve left 17:33 p6steve joined 17:37 p6steve left 17:40 jgaz joined 17:47 p6steve joined 17:55 jjido left
Altreus If I wanted to output all the days of the current month with a field next to each one that I can put a number in, how easy is that and what should I use for the interface part? 18:34
on the terminal that is
japhb Altreus, are you wanting to just display it, or make it interactive? 18:37
Altreus interactive
the next part will be writing out the values so I can pre-fill ones I did in the past :D 18:38
japhb Ah. Then for the terminal side you're limited in the available tooling at the moment (which I try to work on in my spare time, as do a couple other people, but ... $life).
Terminal::Print will let you treat the screen as a printable grid.
Altreus I can happily do it by absolute coordinates tbh 18:39
should be fairly easy to figure out the coordinates of calendar things :)
japhb Yeah, in that case, Terminal::Print is probably a starting point. I know there was someone who'd done a little work towards navigable tables, which is also in the vicinity of your use case, but I'm not sure how far along that is. 18:40
Altreus If that's going then I'm into the idea ... first prototype might just be me typing in the values linewise :)
japhb Yeah, the extra methods that Date has in Raku these days help that a lot.
Altreus might have to install new raku then :P 18:41
japhb has actually been working on a time-and-date TUI app using Terminal::Print this week, oddly enough ... but it's not a calendar, so not quite what you're going for. 18:42
19:01 mexen left 19:31 jgaz left
Altreus LEAVE++ 19:33
20:05 sena_kun left 20:06 sena_kun joined
Altreus I've thrown together a prototype that just uses get() instead of doing anything fancy :D 20:09
20:18 guifa joined
Voldenet Actually, drawing a calendar with raku api is difficult 20:27
m: say now.Date.earlier(:2months).first-date-in-month.map({ .week-number, .gist })
camelia ((52 2022-01-01))
Voldenet it has bitten me before 20:29
it's pretty counterintuitive
20:36 zacts joined
japhb Voldenet: You mean the week number that wrapped from the previous year? 20:38
(If so, that's because ISO weeks are defined to always include Thursday, so they bleed across the boundary) 20:39
m: say Date.today.truncate-to('year').week 20:40
camelia No such method 'truncate-to' for invocant of type 'Date'. Did you mean
'truncated-to'?
in block <unit> at <tmp> line 1
japhb m: say Date.today.truncated-to('year').week
camelia (2021 52)
Altreus Drawing a single month was quite easy, though
japhb Voldenet: Note the week-year there
Altreus: yup. :-)
Voldenet Sure, there is logic to it 20:42
japhb Altreus: Little tip I noticed when preparing for internationalization: enum WeekStartDay < Sunday Monday Tuesday Wednesday Thursday Friday Saturday >; my $week-start = Monday; my @headers = @day-names.rotate($week-start);
Turns out weeks are really odd things in some cultures. This one amazed me: en.wikipedia.org/wiki/Pawukon_calendar 20:43
Voldenet I'd probably use some different property names though, like { .iso-week-year .iso-week-number } 20:44
japhb (My tool needs to do tabular reports across the days of a week, but there are at least 4 major international conventions for starting day of the week.)
Voldenet: Sure. Raku uses ISO standards for Date and Time where appropriate, so that's the default for such things where it would otherwise be ambiguous. 20:46
Voldenet otoh .week-number makes no sense without that iso definition
japhb There are some other possible conventions, but yeah, there's a reason we use the ISO def. 20:47
guifa japhb voldenet: I couldn't even hard code stuff for Intl::Format::DateTime. to calculate the week number, I need to know minimum days in a week to be a year start, and the first day of the week in the local system 20:50
so for a first-week-with-thursday, assuming a Sunday-first system, the minimum days would be 3, but on a Monday-first system, it would be 4 20:51
japhb guifa: Yeah. The tool I'm working on uses partial weeks (if necessary) at start and end of each month, kinda the way a calendar would, but has to care about ISO week as well, so ends up doing some funky figuring to use two somewhat incompatible views on the same thing. 20:54
I ended up defining a DateInterval role stubbing the methods I actually needed, and then implementing in several classes for different ways of looking at dates, so the rest of the code can just pass around DateInterval:D and pretend those weird humans aren't so weird after all. 20:55
Voldenet The biggest problem is that dateish objects can't have useful weeks and weekdays without knowing locale 20:57
guifa Voldenet: User::Language :-) 20:58
err, Intl::UserLanguage but I'm transitioning it to User::Language in my next update 20:59
Voldenet User's language is not locale
It's actually pain when applications use locale as language and vice versa 21:00
Locale is the thing that decides where your weekday starts, language decides what's its name 21:03
guifa Voldenet: the two have been overlapped forever
UserLanguage reports the most complete BCP47 tag that it can, including T and U extensions that include information about, e.g., calendar type and weekday starts 21:04
unfortunately, I can only grab so much of it from command lines, and I'll probably have to start using native call soon to probe the OS a bit more 21:05
[Coke] I have worked on a project where available languages included "english", "french canadian", and "german", which bugged me.
21:05 epony left
japhb If it's a language, it would need to be "Canadian French" I would assume? Because "French Canadian" sounds like it refers to a population group, not a language. 21:06
[Coke] It's the codes, not these words.
japhb (And I don't even know what the official designation of that population group would be officially, actually.) 21:07
Ah
[Coke] the important part being that one is tied to a country but the others aren't.
(which could make sense, but not in our case.)
japhb Yeah, gotcha.
Voldenet Maybe US English would've be better, but German German is a bit difficult to look at 21:09
s/be/been/
[Coke] ^_^
Geth doc: patrickbkr++ created pull request #4046:
Give the more obvious answer to "Where are bin/ scipts installed?"
21:12
guifa The way it works in CLDR is that there's a formula for languages 21:20
21:20 discord-raku-bot left
guifa for English, by default it's "Language (Region)" 21:20
21:21 discord-raku-bot joined
guifa but where there are common terms, they get overridden (and that's on a langauge-by-language basis) 21:21
so Canadian French will pull up for English users, but for someone in Japan, it might just do French (Canada) (but written in Japanese)
For Geman, I think, you'd probably get German (Germany), German (Austria), Swiss German 21:23
21:24 zacts left 21:30 melezhik joined
melezhik my cro app reuse db handler to mysql database  across http requests, so I hit this error on and off - DBDish::mysql error - Unsupported Concurrency: Connection used by multiple threads simultaneously 21:31
github.com/raku-community-modules/...issues/222
any thought now can I handle / fix that on cro app side?
Geth Documentable: patrickbkr++ created pull request #158:
Change uses of Doc::TypeGraph to the new name as well
21:36
21:38 melezhik left 21:42 guifa left
Voldenet m: my $x = 1; $x but= Stringy; 21:56
camelia ===SORRY!=== Error while compiling <tmp>
Cannot make assignment out of but because structural infix operators are too diffy
at <tmp>:1
------> my $x = 1; $x but=⏏ Stringy;
Voldenet m: my $x = 1; $x = $x but Stringy; 21:57
camelia ( no output )
Voldenet most weird
22:05 zacts joined 22:47 zacts left 23:06 aru left 23:09 aru joined 23:23 discord-raku-bot left, discord-raku-bot joined