🦋 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.
00:07 Manifest0 left 00:47 greaser|q left, greaser|q joined, greaser|q is now known as GreaseMonkey 01:56 hulk joined 01:58 kylese left 02:15 hulk left, kylese joined 02:17 Sgeo_ joined 02:19 Sgeo left
wayland76 Do we have a Wiki where it'd be suitable to put a comparison of eg. DataQueryWorkflows, Dan, DBIish, and TOP? I'm happy to start it, but would like antononcube and librasteve to also be able to edit. 02:51
[Coke] I'd make a shared project on github and use that wiki probably 02:55
wayland76 Oh, yeah, smart idea. Thanks! 03:07
I can't find the documentation on the .so method. All I've found so far is a reference on the Signature Literals page. Any tips? 03:09
antononcube, is there a way I'm missing that lets you give hints to the DateTime::Grammar? ie. locale? 03:26
[Coke] docs.raku.org/routine/so
and that links to other primary sources 03:27
04:01 thaewrapt left 04:17 xelxebar left 04:18 xelxebar joined 04:19 thaewrapt joined 04:24 thaewrapt left 04:35 thaewrapt joined 04:42 thaewrapt left 04:53 thaewrapt joined
wayland76 [Coke]: Interesting! If you search for "so", that doesn't come up. 04:54
[Coke]: Also, thanks :)
05:00 thaewrapt left 05:10 thaewrapt joined 05:16 thaewrapt left 05:28 thaewrapt joined 05:33 thaewrapt left 05:36 wayland joined, wayland76 left 05:44 thaewrapt joined 05:49 thaewrapt left 06:00 thaewrapt joined 06:05 thaewrapt left 06:16 thaewrapt joined 06:24 thaewrapt left 06:37 thaewrapt joined 06:47 thaewrapt left 06:58 thaewrapt joined 07:07 thaewrapt left 07:18 thaewrapt joined 07:31 thaewrapt left 07:32 Sgeo_ left 07:41 thaewrapt joined 07:47 thaewrapt left 07:48 Woodi left 07:58 thaewrapt joined 08:06 thaewrapt left 08:16 thaewrapt joined 08:21 thaewrapt left 08:28 jpn joined 08:32 thaewrapt joined 08:38 thaewrapt left 08:49 thaewrapt joined 08:54 thaewrapt left 09:05 thaewrapt joined 09:10 thaewrapt left 09:13 thaewrapt joined 09:16 Manifest0 joined 09:18 sena_kun joined 09:30 jpn left 09:58 Woodi joined 11:08 jpn joined 11:13 jpn left
antononcube @wayland76 “DateTime::Grammar” has a role — it can be extended to use “locale hints.” 11:33
12:04 jpn joined 12:09 jpn left
@wayland76 Of course, feel free to submit issues in the GitHub repository of "DataTime::Grammar". 12:27
12:27 swaggboi left 12:33 swaggboi joined
wayland m: use DateTime::Grammar; datetime-interpret("26/01/2001") 12:33
camelia ===SORRY!=== Error while compiling <tmp>
Could not find DateTime::Grammar in:
/home/camelia/.raku
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-in…
wayland On my local, it says: Month out of range. Is: 26, should be in 1..12 12:34
antononcube @wayland Does datetime-interpret("26.01.2001") work? 12:37
wayland Yep :) 12:38
I figured out I'm trying to match rule date6 12:39
raku -e 'use DateTime::Grammar; say datetime-interpret("26/01/2001", rule => "date6")' 12:40
That line above returns a Nil
antononcube @wayland I was going to write that -- I see token date6 defined for "your" date format, but I guess I have to define an overall regex, not just a token. 12:41
@wayland Yeah, the "date6" rule/token is for month names. This should work: raku -e 'use DateTime::Grammar; say datetime-interpret("26/Jan/2001", rule => "date6")' 12:43
@wayland I guess I have to define a new rule ("just for you.") 12:49
Ok, for all the people using your date format spec. 🙂 12:50
wayland Yeah, it's an Australian thing, I think. 12:55
12:59 jpn joined
antononcube To be honest, working with dates- and date-time formats is both difficult and boring. It seems for your date format there should be a locale parameter handed to the grammar. 13:01
Which means (other) locale specs have to be respected.
wayland Sure. If you don't get to it any time soon, that's fine.
antononcube 👍 13:03
wayland (I threw together a quick Grammar just to handle my specific case :) )
I had a look at /usr/lib/locale/en_AU.utf8/LC_TIME and I can see it probably has the relevant info, but probably not in a useful format 13:04
(it's binary) 13:05
13:05 jpn left
wayland Yeah, it looks like we need something that calls the C function "localeconv", and returns the struct in "man 7 locale". Unless that's already happening somewhere that I've missed. 13:08
(For the record, I think a more useful name than "date6" would be "dmy-string", meaning that it's in DMY order, and that the month is a String instead of numeric) 13:09
Anyway, I've successfully made my Raku program go "Segmentation fault (core dumped)", so it's time to go to bed :) 13:13
m: use Cairo; my $surface = Cairo::Surface::PDF.new(filename => "file.pdf", :width(1683e0), :height(2383e0)); $surface.show_page()
camelia ===SORRY!=== Error while compiling <tmp>
Could not find Cairo in:
/home/camelia/.raku
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/rakudo-m-inst-2/share/p…
wayland That's the one that core dumps on my local 13:14
I'll try to put a bug report in tomorrow.
13:32 teatime left
antononcube @wayland Yeah, the "dmy-date" rule/tokne can be implemented without being attempted by default. I.e. using it via datetime-interpret("26/2/2001", rule => "dmy-date")'. 13:41
13:48 bdju left 13:50 bdju joined 13:51 bdju left 13:52 bdju joined 13:56 jpn joined 14:02 jpn left 14:53 jpn joined 14:58 jpn left 15:35 jpn joined 15:41 jpn left 15:53 haxxelotto joined 16:04 haxxelotto left, haxxelotto joined 16:26 jpn joined, Sgeo joined 16:30 jpn left 16:39 jpn joined 16:44 jpn left 16:53 haxxelotto left
[Coke] wayland: That's how I got there, was searching for so. The problem is that it's not the first hit. :| 17:15
17:24 jpn joined 17:44 jpn left 17:56 jpn joined
tbrowder hi, i'm looking again at maybe using MAIN for arg handling. my main problem with it is no apparent way to control the output arg and descrip widths in a terminal. i have suggested allowing options to allow arg and descrip line wrapping but got shot down. 18:15
is there any "easy" way to hook into the output to handle it downstream? 18:17
ah, i think lizmat's App::Rak has a solution... 18:21
lizmat App::Rak doesn't know about terminal widths 18:22
18:27 jpn left
tbrowder but the output seems to be a comfy width 18:30
if MAIN could recognize a \n inside a #= comment that would be a start 18:32
lizmat It does with RakuAST 18:33
it's just that MAIN processing doesn't use that afaik
tbrowder cool! i need to try getting that version working 18:34
...and not expect MAIN to be changed... 18:37
18:51 jpn joined 19:15 jpn left 19:43 lizmat left 21:42 jpn joined
[Coke] . 21:53
22:07 jpn left 22:17 sena_kun left 22:24 lizmat joined 23:29 ttyyls left 23:30 ttyyls joined 23:55 kst left 23:56 Manifest0 left