🦋 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.
[Coke] xliff: missing closing ) near arbitrary list ? 00:12
tellable6 [Coke], I'll pass your message to Xliff
guifa o/ 02:11
tellable6 2023-06-04T13:39:10Z #raku-dev <finanalyst> guifa codesections suggested I contact you about internationalisations.
guifa .tell finanalyst yeah, I'm actually currently doing a ground-up rewrite of my port of Fluent which will make stuff crazy easy to do 02:12
tellable6 guifa, I'll pass your message to finanalyst
tonyo uzl[m]: merged, ty++ 02:53
Voldenet SmokeMachine: Yes, visit instead of multiple match methods should work, I'm not a fan of find-nodes because it always produces whole collection and I think that Seq returned from `gather visit({ … })` is going to be more flexible 04:11
leont Good * 05:15
librasteve weekly: rakujourney.wordpress.com/2023/06/...accessors/ 08:11
gfldex librasteve Things that don't got names have a hard time to leak. 08:16
m: $++ for .?the-win;
camelia ( no output )
gfldex Why .[$++] works is a nice rabbit hole tho. :-> 08:17
Nemokosch what does it mean for it to "work"? 08:41
leont tonyo: I would really like to add fez to repology, but that requires it to expose an API to give me all modules, their versions and a URL to download them (repology.org/docs/requirements). Could you add such a target to the fez server? 09:13
Current index.json gives all versions instead of latest, that's a bit unfortunate for their purposes I believe 09:15
Geth planet.raku.org: 7b81fd13da | (Elizabeth Mattijsen)++ | perlanetrc
Follow rename of Steve Roe's website
09:18
leont I guess I'd also need a way to fetch the META6.json for any package. 09:24
librasteve gfldx: thanks for the feedback ... sadly I do not know what you mean 09:43
i am a bear of small brain 09:44
SmokeMachine Voldenet: Yes, I plan on using visit-children for that, but anyway I'll need a few multi match()es for comparing things that are not nodes, RakuAST::IntLiteral's value, for example, right? 09:57
lizmat PSA: there will not be a Rakudo Weekly today 10:59
Voldenet I hate accidentally pulling master instead of main, creating a build out of it just to realise that it's 6 months old (`Д´)ノ︵ ┻━┻ 11:11
Voldenet SmokeMachine: true, but complexity can be reduced to handling significantly fewer cases, since things like ArgList get visited 11:32
SmokeMachine Voldenet: yes! Sure! I was doing that way mostly for trying if that would work… 11:33
Voldenet: thank you for the advice! :) 11:34
Voldenet btw, matching on RakuAST::Literal is enough, the subtypes exist only for qast 11:35
SmokeMachine Voldenet: good to know! Thanks! 11:39
lizmat yeah, and you even don't have to separate values on creation anymore 11:48
RakuAST::Literal.new(42) would create an IntLiteral, and R::Literal.new("foo") would create a StrLiteral
SmokeMachine Voldenet ^^ 11:49
m: use v6.*; say RakuAST.Literal.new(42)
camelia No such method 'Literal' for invocant of type 'RakuAST'
in block <unit> at <tmp> line 1
SmokeMachine lizmat: Also good to know! Thanks! 11:50
lizmat m: use v6.*; say RakuAST::Literal.new(42)
camelia RakuAST::IntLiteral.new(42)
SmokeMachine lizmat: have you seen my plan for my next suggestion for rak?
lizmat yes, I have: please make an issue for that in App::Rak so it doesn't fall through the cracks 11:51
SmokeMachine lizmat: I'm planing on doing the real suggestion once my PoC is more robust and I'm sure what I want is possible... 11:52
lizmat ++SmokeMachine 11:53
Voldenet m: use v6.*; say "42".ast 12:01
camelia No such method 'ast' for invocant of type 'Str'. Did you mean 'AST'?
in block <unit> at <tmp> line 1
Voldenet m: use v6.*; say "42".AST
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::IntLiteral.new(42)
)
)
SmokeMachine Voldenet, lizmat: so, for now, the nodes I can think of (I don't know many nodes) would be RakuAST::Literal and for operators (RakuAST::Infix, RakuAST::Prefix, RakuAST::Postfix, etc).. is there a way to handle all the ops in a unified way (as RakuAST::Literal does for all literals)? 12:03
m: "1 + 2 - 3 * 4 / 5".AST.say 12:04
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::ApplyInfix.new(
left => RakuAST::ApplyInfix.new(
left => RakuAST::IntLiteral.new(1),
infix => RakuAST::Infix.new("+"),
SmokeMachine m: "[+] !(1 + 2)[1..2] ".AST.grep({ .^name.ends-with: "fix" }).say 12:06
camelia ===SORRY!===
No such method 'IMPL-CURRIED' for invocant of type
'RakuAST::Postcircumfix::ArrayIndex'. Did you mean 'IMPL-CURRIES'?
SmokeMachine m: "[+] !(1 + 2)".AST.map(*.^name).grep({ .ends-with("fix") && !/Apply/}).say 12:16
camelia (RakuAST::Infix RakuAST::Prefix RakuAST::Infix)
leont m: use Test; fails-like { fail "HERE" }, X::AdHoc; 12:49
camelia # Subtest: did we fails-like X::AdHoc?
1..2
not ok 1 - expected code to fail but it threw X::AdHoc instead
# Failed test 'expected code to fail but it threw X::AdHoc instead'
# at SETTING::src/core.c/Mu.pm6 line 1112
ok 2…
leont That looks very very wrong to me
(and it's used in three dozen spec test files, so it really should be working correctly) 12:53
leont (of course, it turns out I completely misunderstood fail) 13:26
tbrowder__ hi, i'm trying to use raku code to write a couple of functions described in 'Introduction to Algorithms', third edition, where the authors use a python-like pseudo code to describe them. one thing they use is a set of 1-indexed arrays which i am trying to emulate by unshifting a -1 for each, but i have a bug and am still still debugging. 14:47
however, isn't there a clever way to create such an array in raku?
i guess i could fake with a class... 14:49
*fake it 14:50
that should work, but not very elegant 14:51
anyone having trouble with google chrome? seems to stall--maybe too much AI 14:53
firefox much better
librasteve tbrowder: hi ... can you share the text of the python/pseudo code maybe in a gist and we can take a look? 15:51
tonyo leont: you should be able to get that from the index of 360.zef.pm 16:11
tbrowder__ librasteve: thanks. i think i'll wait a bit till i try some more to check for errors. also, i want to look at augmenting a class or just creating one. 18:29
librasteve yeah sure, no problem 19:07
uzl[m] .tell tonyo I think you forgot to merge it haha. And sure, np! 21:27
tellable6 uzl[m], I'll pass your message to tonyo
Anton Antonov I have an idea for a "brilliant" new package that allows parsers to be constructed in a Functional Programming (FP) manner. Basically, using parser combinators and transformers. What would be a good name for it? I am aware of similar Perl package named "Parser::Combinators" and Haskell package "Parsec". I prefer to call that new package "FunctionalParsers", but may be there is some suitable namespace to use as a 21:36
prefix.
moritz Parser::Functional? 21:43
moritz lots of Parser:: things on metacpan 21:43
Anton Antonov Hmm... I only checked raku.land. 21:54