🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
Anton Antonov @guifa Link(s)? 01:04
guifa Will post as soon as I fixed an issue with the week formatter
guifa is having to do math and ... boo 01:05
guifa Basically I realized that Raku's week-based functions for $datetime were all pretty much based on ISO 01:21
but for proper localization, I needed to be able to adjust the formula. Most of the ones online are optimized for that case, and so I'm working back from a multilayer formula now to see just how slim I can make it 01:22
Anton Antonov @guifa I find programming date both difficult and boring, so, I consider your efforts heroic . 07:35
guifa AntonAntonov: I don't necessarily find it boring, but difficult for sure. It's so easy to have a single digit or operator wrong and everything blows up. 12:05
I'm still trying to figure out the best way to handle adding in new calendar types 12:11
Timezones was one thing because for the most part it doesn't muck with anything involved in calculations other than the offset which is built into DateTIme anyways 12:12
Xliff \o 13:11
tellable6 2023-04-06T15:40:58Z #raku <tonyo> xliff these svg docs from mdn aren't very consistent, you may find some issues with types when you start trying to use the SVG in Ryml
Xliff Happy Caturday!
.tell tonyo No worries. Thanks for your efforts!
tellable6 Xliff, I'll pass your message to tonyo
Xliff Is this a bug?
Cannot resolve caller openDB(Bizzell::Roles::DB:U: Str:D, Hash:D); none of these signatures matches:
(Bizzell::Roles::DB: $name, *%_)
(Bizzell::Roles::DB: $name, $config, *%_)
m: sub a ($b, $c) { say $b.^name; say $c.^name }; my $c = { a => 1 }; a("Bleah!", $c) 13:13
camelia Str
Hash
Xliff ???
Anton Antonov @guifa Again -- heroic considerations. 🙂 13:15
Xliff m: sub a ($b, $c) { say $b.^name; say $c.^name }; my $c = { a => { b=> 2 } }; a("Bleah!", $c<a>)
camelia Str
Hash
guifa I'd love if we could have Dateish and Timeish objects separate, and then it just happens that DateTime fulfills both roles 13:16
Xliff m: my $c = { a => { b=> 2 } }; multi sub ($a) { samewith($a, $c{$a} ); }; sub a ($b, $c) { say $b.^name; say $c.^name }; a('a') 13:16
camelia ===SORRY!=== Error while compiling <tmp>
An anonymous routine may not take a multi declarator
at <tmp>:1
------> ulti sub ($a) { samewith($a, $c{$a} ); }⏏; sub a ($b, $c) { say $b.^name; say $c.
expecting any of:
h…
Xliff m: my $c = { a => { b=> 2 } }; multi sub a ($a) { samewith($a, $c{$a} ); }; sub a ($b, $c) { say $b.^name; say $c.^name }; a('a')
camelia ===SORRY!=== Error while compiling <tmp>
Redeclaration of routine 'a'. Did you mean to declare a multi-sub?
at <tmp>:1
------> ($b, $c) { say $b.^name; say $c.^name }⏏; a('a')
expecting any of:
horizontal whitesp…
Xliff m: my $c = { a => { b=> 2 } }; multi sub a ($a) { samewith($a, $c{$a} ); }; multi sub a ($b, $c) { say $b.^name; say $c.^name }; a('a')
camelia Str
Hash
Xliff m: my $c = { a => { b=> 2 } }; class A { multi method a ($a) { samewith($a, $c{$a} ); }; multi method a ($b, $c) { say $b.^name; say $c.^name }; }; A.a('a') 13:17
camelia Str
Hash
Xliff Huh. That's the entire golf and I can't replicate. 13:18
m: my %c = ( a => { b=> 2 } ); class A { multi method a ($a) { samewith($a, $c{$a} ); }; multi method a ($b, $c) { say $b.^name; say $c.^name }; }; A.a('a')
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$c' is not declared. Did you mean '%c'?
at <tmp>:1
------> { multi method a ($a) { samewith($a, ⏏$c{$a} ); }; multi method a ($b, $c) {
Xliff m: my %c = ( a => { b=> 2 } ); class A { multi method a ($a) { samewith($a, %c{$a} ); }; multi method a ($b, $c) { say $b.^name; say $c.^name }; }; A.a('a')
camelia Str
Hash
Anton Antonov @guifa Is there an "official" Timish role? 13:28
guifa There is not 13:29
guifa In a perfect world, we'd have Dateish, Timeish, and then where we have DateTime we could check for Dateish/Timeish 13:38
guifa right now though, the Dateish role is a bit odd, because while you can assume use Dateish as a generic type constraint (allowing other calendar systems), you can't do the same once time is added in 13:40
Anton Antonov @guifa Would it be hard to make perfect parallel world for you? You can define Timish, then, say, TimeDate that inherits DateTime and plays both Timish and Datish. 13:41
guifa Yeah unfortunately it wouldn't serve my goals. 13:44
I'd like to have a drop in module that suddenly makes other calendar systems available but keep them compatible with everything else in Raku 13:45
DateTime::Timezones does that -- just add it and boom, all DateTimes in Raku are now fully timezone aware
Anton Antonov @guifa I see. You need a suitable placeholder role in Datish or DateTime. 13:47
guifa I think it's doable, but I'm not sure how it would interact with DateTime::Timezones. I need to do some more experiments 13:48
guifa The nice thing is once I'm done, the formatting code only requires one tiny change 13:59
gfldex guifa: If you got a standalone time-object (without a date part), how do you convert that to GPS-time (or any other universal time), if you don't know if it's a leap day? 16:13
guifa: Also, how do you validate a time-object if you don't know if a leap second may pop up? 16:14
guifa gfldex: there wouldn't be a conversion to anything else, as it'd be date agnostic 16:36
Nemokosch leap seconds have been suspended for a long enough time from what I know
from IT point of view, it was super annoying for everyone 16:37
guifa New leapseconds have been suspended for the time being -- basically so they can figure out what to do an avoid a Y2K thing when there's a negative one included (fwiw, the ubiquitous tz library already supports them. another reason to not roll your own especially when tz is crazy portable) 16:50
but you still have to deal with the current ones. sort of like if they got rid of DST -- still gotta deal with the older times
Nemokosch the older ones can be just listed. The Rakudo implementation does something to deal with them, even if I'm not completely sure it does "the right thing" 18:20