šŸ¦‹ 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:14 pony joined 01:05 [Coke] left 01:07 [Coke] joined 01:13 hulk joined 01:14 kylese left 02:15 hulk left, kylese joined 02:29 kst`` left 02:35 human-blip left 02:37 human-blip joined 03:02 wayland76 left, wayland76 joined 03:05 wayland joined, wayland76 left 03:11 stanrifkin joined 03:13 stanrifkin_ left 03:25 wayland left 03:26 wayland joined 03:29 wayland left, wayland joined 03:31 wayland left 03:32 wayland joined 03:45 kylese left 03:47 derpydoo joined, kylese joined 03:54 wayland left 03:55 wayland joined 04:09 wayland left, wayland joined
patrickb antononcube: Yes! I'm still interested in that. Did you do something about it? If so, thank you very much! 04:11
04:59 Sgeo__ joined 05:02 Sgeo_ left 05:03 derpydoo left 05:05 phogg` joined
wayland Do we have anything equivalent to www.php.net/manual/en/language.enu...backed.php ? 05:06
05:06 phogg left
coranila m: enum ( Foo => "Bar", Baz => "Quux" ); say ~Foo 05:13
evalable6 Bar
Raku eval Bar
coranila m: enum ( 0 => "Oh no Peano!" does role { method Numeric() { 1|-1 but 0 } }; say +0 # hmmm 05:14
evalable6 (exit code 1) ===SORRY!=== Error while compilin…
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1) at /home/glot/main.raku:1 ------> umeric() { 1|-1 but 0 } }; say +0 # hmmmā<EOL> expecting any of: postfix statement end statement modifier statement modifier loop
evalable6 coranila, Full output: gist.github.com/e394d8bd3a166d88b3...23bc5bda5b
coranila m: enum ( 0 => "Oh no Peano!" does role { method Numeric() { 1|-1 but 0 } }); say +0 # hmmm
Raku eval 0
evalable6 0
wayland Is there something like TWEAK that gets called on roles when objects that do them are instantiated? 05:38
06:29 coverable6 left, evalable6 left, shareable6 left, bisectable6 left, linkable6 left, nativecallable6 left, greppable6 left, benchable6 left, tellable6 left, sourceable6 left, quotable6 left, bloatable6 left, releasable6 left, unicodable6 left, notable6 left, committable6 left 06:32 linkable6 joined, shareable6 joined, bisectable6 joined, unicodable6 joined, releasable6 joined 06:33 nativecallable6 joined, committable6 joined, evalable6 joined, coverable6 joined, notable6 joined, benchable6 joined, quotable6 joined 06:34 sourceable6 joined, greppable6 joined, tellable6 joined, bloatable6 joined, Aedil left
wayland Also, if you try to access an attribute ($.my-attribute) inside a submethod, then even if the submethod is NEVER CALLED, raku still refuses to run the code, complaining about actions on partially constructed objects. 07:51
07:54 wayland left, wayland76 joined
patrickb wayland: re tweak for roles, currently no (except for code directly in the main line of the role). But in 6.e it'll work thanks to vrurgs extensive work on roles. 08:13
tellable6 patrickb, I'll pass your message to wayland
08:20 wayland76 left 08:21 wayland76 joined 08:25 wayland_ joined 08:26 wayland76 left 08:27 wayland76 joined 08:28 wayland_ left, wayland76 left 08:29 wayland76 joined 08:30 Sgeo__ left 08:31 wayland joined, wayland76 left, wayland left 08:34 wayland76 joined 08:35 Aedil joined 08:41 wayland76 left 08:42 wayland76 joined 08:43 wayland76 left, wayland76 joined 08:44 wayland joined, wayland76 left 08:45 wayland left, wayland joined, wayland left 08:46 wayland76 joined, wayland76 left, wayland joined 08:52 wayland left, wayland joined 08:54 wayland left 08:56 wayland76 joined 08:57 wayland76 left, wayland76 joined 08:58 wayland76 left, wayland joined 09:02 wayland76 joined, wayland left 09:05 wayland joined, wayland76 left 09:09 wayland left 09:10 wayland joined 09:12 wayland76 joined 09:13 wayland76 left, wayland76 joined, wayland76 left 09:15 wayland76 joined, wayland76 left, wayland76 joined 09:17 wayland left 09:18 wayland76 left, wayland76 joined 09:20 wayland76 left 09:21 wayland76 joined 09:22 wayland joined, wayland76 left 09:30 wayland left, wayland joined 09:31 wayland left 09:35 wayland joined
wayland patrickb: You mean TWEAK itself will work? 09:36
tellable6 2025-05-03T08:13:14Z #raku <patrickb> wayland: re tweak for roles, currently no (except for code directly in the main line of the role). But in 6.e it'll work thanks to vrurgs extensive work on roles.
wayland As opposed to, say, the COMPOSE phaser?
m: role A { has $.a = 1; submethod m1() { say $.a; } }; $c = A.new(); 09:38
camelia ===SORRY!=== Error while compiling <tmp>
Virtual method call $.a may not be used on partially constructed object (maybe you mean $!a for direct attribute access here?)
at <tmp>:1
------> { has $.a = 1; submethod m1() { say $.a<HERE>; } }; $c = …
wayland Note that I never actually called the method, and yet it still complained about it.
patrickb: I've tested it, and you're right! vrurg++ ! :) 09:41
That still doesn't negate the problem with submethods though. 09:49
vasko SmokeMachine I know what you mean but if you think about what it actually is: It's a model of something (e.g. Task) that has routes that can model what users can do with said thing. It also happens to have an HTML representation. 09:50
wayland Anyone interested in the PHP Backed-Enum that I mentioned earlier (including coronila), raku.land/cpan:CTILMES/BitEnum gets us about half of that. 09:53
10:22 derpydoo joined 10:53 stanrifkin left 11:38 derpydoo left 11:39 Aedil left 11:45 Aedil joined
antononcube @patrickb Hmm… yes and no. Long time ago (ā‰ˆ2 years ago) I ingested IRC logs in order to do data- and semantic analysis over them. I could not ingest them using Raku, so, I used Mathematica. 12:15
I am interested in all-Raku solution for all the steps: ingestion, semantic analysis, data- or time series analysis, plots and visualizations. 12:16
@patrickb So, I am hoping someone to come up with IRC logs ingestion script. For that ā€œingestionā€ is an array or records, each record corresponding to an IRC message, say a hashmap with author, timestamp, and content. 12:18
tbrowder hi, i'm working on a PR updating the Pod::TreeWalker distro in raku-community-modules. the module won't work without the user-provided Listener object, but in the constructer it's marked "is built" which I believe should be marked "is required" instead. thoughts anyone? 12:20
13:32 lichtkind joined 13:39 Xliff joined
Xliff \o 13:39
tellable6 2025-04-29T08:37:15Z #raku <Voldenet> Xliff: last time I've check lock.protect took around 3us, so you can have 1000 components just fine - it depends if you are going to render scrollable lists with N items in TUI
Xliff Can someone tell me why I'm getting this exception? "Failed to find '/home/cbwood/.raku/META6.json' while trying to do '.r'" 14:02
14:11 Xliff left 14:45 stanrifkin joined
Voldenet ab5tract: I'll try to make an issue with it – I'm not sure if the measurements I did are still fine on the current version, but I'll include them too 15:05
15:12 apac joined 15:14 apac left 15:15 apac joined 15:21 MasterDuke joined
Voldenet ab5tract: github.com/rakudo/rakudo/issues/5873 I'm not sure if I included anything, but I hope it makes sense 15:31
tbrowder: no, is built is correct, `is required` means that the field should have value, `is built` gives you ability to pass that in the constructor 15:48
m: class X { has Str $!p is built; method say { ("and I say $!p").say } }; X.new(p => "heyyeyaaeyaaaeyaeyaa").say # example 15:50
camelia and I say heyyeyaaeyaaaeyaeyaa
Voldenet m: class X { has Str $!p is required; method say { ("and I say $!p").say } }; X.new(p => ":(").say # non-working example
camelia The attribute '$!p' is required, but you did not provide a value for it.
in block <unit> at <tmp> line 1
Voldenet though you're partially correct 15:51
m: class X { has Str $!p is built; method say { ("and I say $!p").say } }; X.new().say # this will accept no value in the constructor
camelia Use of uninitialized value element of type Str in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
and I say
in method say at <tmp> line 1
Voldenet m: class X { has Str $!p is built is required; method say { ("and I say $!p").say } }; X.new().say # this will even have nice message
camelia The attribute '$!p' is required, but you did not provide a value for it.
in block <unit> at <tmp> line 1
wayland .tell Xliff: Under what conditions? Is .r a method? Does it exist? Are you calling it? 16:13
tellable6 wayland, I'll pass your message to Xliff
SmokeMachine vasko: please, correct me if I’m wrong, but it seems to me you want a rest-resource instead of a component… and I think that makes sense… now I’m planing on creating a new module RestResource that will be a role that will add routes to CTO the same way ctomponents currently do. Change Cromponents to use that. It will also have a trait ā€œis resourceā€ that will handle an attribute as a resource and auto implement the 16:46
needed methods depending on type, that way, one could do something like: class Task does Cromponent { …; has Bool $.done is resource } and that would add GET /task/<id>/done, PUT /task/<id>/done and DELETE /task/<id>/done. The problem with that is to integrate that with Red models… it will need a way to call self.^save after changing its value… maybe it needs something like: is resource{ :after{ self.^save } }
16:52 simcop2387 left
SmokeMachine librasteve: do you think we could share that RestResource between Cromponent and Air? 17:05
antononcube So, when is fez going to be fixed? 17:21
It happens to often to me that using fez upload does not produce "uploads" and does not produce any messages of what is wrong. 17:22
I think there was some discussion (or promises) for better diagnostics of fez failures.
I think there is a shared "know-how" about fez problems diagnosis here (in IRC.) It is good to know is it still actual. (I.e. fez was improved.) 17:24
librasteve SmokeMachine: I think that (a) Cromponent services could be decomposed a bit - such as roles for (a) the %.holder and loader, (ii) $.base and $.url and (iii) setting up routes (which is most of the code) and (b) the route response would need to be selectable for (i) crotmp, (ii) HTMX and (iii) REST since HTMX is usually offered as an API (returning HTML fragments) alongside a full REST API (returning JSON). So I 17:32
wouldn't call it RestResource since for HTML it would be be HTMXResource... ;-)
SmokeMachine Maybe I should call that CroResource… 17:36
librasteve: Could you expand the first part of your response? 17:37
librasteve sure (referring to github.com/librasteve/Air/blob/mai...t.rakumod) - which I forked from Cromponent in Nov ... (i) holder / loader is lines 245-257 ... basically this is a default to keep the holder of all the Cromponents in the type object ... [also serial allocation], (ii) base / url is lines 259-269 to have the Cromponent track its own url and (iii) is the main set up of routes (which iirc 17:58
guess is largely unchanged from your work except that the MYLOAD, MYCREATE etc defaults were moved into Cromponent to declutter the user code. So MAYBE we could have something like class Cromponent does Cromponent::Id does Cromponent::Url does Cromponent::Resource[CroTmp|HTMX|Rest] {}
btw I am happy for you to decide if this has any merit or just ignore me is fine too... 17:59
18:13 Sgeo joined 18:48 apac left 19:12 Aedil left 19:21 MasterDuke left 19:33 apac joined 19:34 simcop2387 joined
ab5tract .weekly github.com/ab5tract/resource-wrangler 21:33
hmm, I guess I didn't do that right
tbrowder Voldenet: thanks for your comments. i’m still experimenting with the actual use of the module, but, so far, i don’t agree that ā€˜is built’ is practically useful. 21:46
but i don’t have a great track record using ā€˜is built’ either šŸ˜‚ 21:47
antononcube weekly: github.com/ab5tract/resource-wrangler 21:53
notable6 antononcube, Noted! (weekly)
antononcube @ab5tract weekly: instead of .weekly . 21:54
ab5tract weekly: github.com/ab5tract/resource-wrangler 21:56
notable6 ab5tract, Noted! (weekly)
ab5tract thanks antononxube
22:09 apac left 23:02 wayland76 joined, wayland left 23:15 simcop2387_ joined, simcop2387 left 23:16 simcop2387_ is now known as simcop2387 23:22 guifa joined
guifa o/ 23:23
23:32 lichtkind left 23:46 guifa left 23:53 wayland76 left, wayland joined 23:58 DarthGandalf left