| 24 Nov 2025 | |||
| disbot5 | <nahita3882> apart from &die, one can &fail | 20:32 | |
| <nahita3882> m: try fail 29; $!.payload.put | 20:33 | ||
| <Raku eval> 29 | |||
| <librasteve> .oO | |||
| <nahita3882> m:try fail 29; $!.WHAT.say' | 20:34 | ||
| <Raku eval> Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Two terms in a row at /home/glot/main.raku:1 ------> try fail 29; $!.WHAT.say⏏' expecting any of: infix infix stopper statement end statement modifier statement modifier loop | 20:35 | ||
| <nahita3882> m: try fail 29; $!.WHAT.say | |||
| <Raku eval> (AdHoc) | |||
| lucs | So &die and &fail do that, okay (although fail wraps but doesn't throw). | 22:00 | |
| disbot5 | <librasteve> lucs: what is the purpose of your question? do you have a code problem to solve? | 22:02 | |
| lucs | librasteve: I'm mucking around with Exception handling in my code (going relatively well), and was just reading the docs, and that part was unclear to me. | 22:21 | |
| disbot5 | <nahita3882> i think only &die & &fail do that | 22:36 | |
| <nahita3882> based on searching for AdHoc in Rakudo's code | 22:37 | ||
| <nahita3882> documentation may be a little less mysterious by saying, e.g., "i.e., &fail and &die" or something | 22:38 | ||
| <nahita3882> if that's the case | |||
| lucs | Nahita: aha, thanks for the search. | 23:11 | |
| Yeah, maybe the doc just needs a bit of tweaking (not quite sure how to put it though). | |||
| 25 Nov 2025 | |||
| disbot5 | <simon_sibl> is there a good xlsx lib for Raku ? I tried to use raku.land/zef:raku-community-modul...heet::XLSX but I get an error everytime when trying to access the $cells with [0;0] Too few positionals passed; expected 2 arguments but got 1 in block at /home/sibl/Documents/git/star/share/perl6/site/sources/22B14971541474027035F5EA10CC7FEAD3BA88D8 (Spreadsheet::XLSX::Worksheet) line 48 in method | 07:16 | |
| idx-from-colref at /home/sibl/Documents/git/star/share/perl6/site/sources/22B14971541474027035F5EA10CC7FEAD3BA88D8 (Spreadsheet::XLSX::Worksheet) line 48 in method maybe-load-from-backing at /home/sibl/Documents/git/star/share/perl6/site/sources/22B14971541474027035F5EA10CC7FEAD3BA88D8 (Spreadsheet::XLSX::Worksheet) line 118 in method AT-POS at | |||
| /home/sibl/Documents/git/star/share/perl6/site/sources/22B14971541474027035F5EA10CC7FEAD3BA88D8 (Spreadsheet::XLSX::Worksheet) line 69 in sub postcircumfix:<[; ]> at /home/sibl/Documents/git/star/share/perl6/site/sources/980FC23D6FE0F2A5C012026C23A9D53F71A91E74 (Spreadsheet::XLSX) line 342 in block <unit> at ./xlsx.raku line 11 also the example in the readme seems to have error, the $workbook.worksheets.name requires a [0] | |||
| after worksheets to work otherwise .name on a list doesnt work and raku.land/zef:FRITH/Spreadsheet::Libxlsxio, is simply impossible to work with for me | |||
| <simon_sibl> I just need to be able to read the sheet, and the first library should be able to do it, but for some reason, it breaks | |||
| <simon_sibl> well I will just use Spreadsheet::Read from Perl5 amazing Raku can just do that and even improve on the syntax xD | 07:27 | ||
| <librasteve> lucs: thanks for clarifying, I tend to be of the “it works or it doesn’t work” mindset, so sometimes I don’t really get questions that probe stuff like “why does Raku do that”, or “how else can this be done” … mind you I learn a little bit every time | 08:12 | ||
| <librasteve> lucs: maybe, if you have a nice idea (short summary) of exceptions, you could post as a gist and we can put that in the Raku Tips n Tricks in the weekly? | 08:13 | ||
| <librasteve> SIBL: please can you raise an issue on Spreadsheet::XSLX and post the link here, I’ll try and take a look at it. | 08:16 | ||
| <simon_sibl> @librasteve here it is github.com/raku-community-modules/.../issues/28 🙏 | 08:27 | ||
| <librasteve> brilliant, thanks! | |||
| disbot6 | <neekotism> Really? I'm interested. | 14:55 | |
| <simon_sibl> oh well, here is the very short code perl #!/usr/bin/env raku use Spreadsheet::Read:from<Perl5>; use Template:from<Perl5>; my $sheet = Spreadsheet::Read.new('sheet.xlsx').sheet(1); my @team = $sheet.column(2)[1..*]; my @lang = $sheet.column(3)[1..*]; my @rewa = $sheet.column(4)[1..*]; my @cols = <team lang reward>; my %db; for @team Z @lang Z @rewa -> @row { my %row-data = @cols Z=> @row; for | 15:05 | ||
| %row-data.kv -> $col, $val { %db{$col}{$val}.push: %row-data; } } | |||
| <neekotism> That's really cool. Does it work well? | 15:08 | ||
| <simon_sibl> yep perfectly | |||
| <simon_sibl> very nice feature | 15:09 | ||
| <simon_sibl> without all the -> and @{$var} etc. | |||
| <neekotism> That's very convenient. Has this always been a feature? | 15:10 | ||
| ab5tract | neekotism: Inline::Perl5 pre-dates the original Christmas release of Perl 6 :) | 15:14 | |
| nine++ for putting together a really solid piece of cross-language interfacing | |||
| simon_sibl: not a nitpick, just wanted to state my preference for [Z] when zipping multiple thingies | 15:15 | ||
| too many infix Zs and I start to get dizZy ;) | 15:16 | ||
| disbot6 | <simon_sibl> aah havent thought of that one, indeed can make it more readable | 15:20 | |
| <neekotism> Very nice. I never knew about this. It changes a lot of things for me. | 15:21 | ||
| ab5tract | neekotism: you can even compile your Perl with a switch that allows multiple Perl5 interpreters to run in the same address space | 15:22 | |
| you can use Raku async goodness to coordinate code running across multiple Perl interpreters | 15:23 | ||
| *you can then use | |||
| disbot6 | <neekotism> I see! Thank you very much for telling me about it. I can imagine how powerful it is. | 15:29 | |
| ab5tract | I hope it proves useful! Don’t hesitate any cool outcomes :D | 15:36 | |
| disbot6 | <simon_sibl> there are some equivalent (probably less feature than the Perl one) for Go and Python raku.land/cpan:AZAWAWI/Inline::Go raku.land/zef:slavenskoj/Inline::Python3 (I had more luck with Inline::Python since I dont use pyenv) | 15:43 | |
| <simon_sibl> perl #!/usr/bin/env raku use Inline::Python; use string:from<Python>; use re:from<Python>; say re::split('\W+', 'Words, words, words.'); say string::capwords('foo bar'); $ ./another.raku [Words words words ] Foo Bar | 15:44 | ||
| <neekotism> That's really cool. | 15:45 | ||
| <antononcube> How hard it is to write a new MS Excel ingestion package from scratch? Is there a mainstream, non-corner-case format that is easy enough ingest? | 15:46 | ||
| <librasteve> antononcube: note the issue that SIBL filed above ... may be simpler to get that to work ;-) | 15:52 | ||
| arkiuat | lucs, nahita3882, thanks! Now I understand what github.com/Raku/doc/issues/4658 is complaining about much better | 17:19 | |