Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
SmokeMachine is there a way to use inline template? 00:26
jnthn Xliff: docs.raku.org/type/Telemetry is probably worth a look; don't think there's anything for Cro to specifically do in this area. 01:27
SmokeMachine: Can do a custom template repo; see modules.raku.org/dist/CWT-Reposito...finanalyst for example (and things already merged for the next Cro release will ease that a bit) 01:29
Xliff: Just assign into a throw-away variable so it won't be sunk 01:31
(to avoid the warning)
SmokeMachine jnthn: great, thanks! Another question, it seems a sub's signature is not accepting `|c`should it be accepted? any way of making it work?
jnthn "a sub"?
SmokeMachine `<:sub execute($cmd, |c)></:>` 01:32
jnthn No, that's not supported.
SmokeMachine :( what about +@ or any slurp? 01:33
jnthn Nope.
SmokeMachine :(
thanks
jnthn It's a templating language. Please but your complicate stuff elsewhere, where there's a chance it can be tested. :/
s/but/put 01:34
I can kinda imagine doing slurpy @ and % in it. |c is really awkward because it doesn't have a sigil so doesn't sit well with the rest of the template language. 01:35
SmokeMachine if I pass a function inside the context, can I run it?
you could pretend | is the sigil...
jnthn If you pass an object you can call methods on it. See also parts
I could, but I won't. :)
Slurpy params are probably a reasonable request, though. 01:36
So far as Mac goes, I happily merge PRs, but I won't spend any of my own time on it. It's worthless, every Mac OS release breaks something else. 01:38
SmokeMachine passing a capture as parameter (`<&execute("toggle", \(.id))>)>`) won't work either, right? 01:40
jnthn No.
SmokeMachine it seems neither do `<&execute("toggle", [.id])>)>`(sorry for keep asking) 01:41
(I mean [.id,]) 01:42
jnthn No. I expect a template language to be rendering the data it's given, not synthesizing new data structures as it goes. Testing the output of a template is fraught, so I figured keeping the language simple pushes this logic out of the templates into something that stands a chance of being testable. 01:46
Of course, it's a tricky balance to strike, in so far as it's nice to be able to abstract presentation stuff too. 01:48
(Which is why slurpy params/args feels like a reasonable thing to ask for) 01:49
SmokeMachine maybe the problem is what I'm trying to do (that's just a test to see if it's possible)
jnthn (But also why I'm reluctant to see the template language expand to being close the a general purpose language :)) 01:50
sigh, *to a. I should probably already be sleeping, I've been tired all week anyway. 01:51
At least vacation is coming soon.
Although there's time for a Cro release before it :)
'night o/ 01:52
SmokeMachine my test is to make a way to make the template work kind on web components and having a way to do something like `<a onclick=<&run("fund-name", @parameters)>`and it would add a JS on it that would (when clicked) send a WebSocket message, the server would react to that message, re-render the template, send it back to by through WebSocket and the JS would replace it...\ 01:53
good night! sorry for interrupting. I hope you have some time to rest... :) 01:54
10:51 sena_kun joined 14:51 Xliff left
SmokeMachine should a :sub defined inside a :part be accessible from outside that :part? 19:45
jnthn I'd not expect it to be; :sub decls are meant to be lexical, as in Raku 20:19
So a sub declared inside a sub should only be visible inside of that sub.
If they are visible outside of the part that's probably a bug (although I'm curious how it'd happen, knowing how the code-gen works...) 20:20
20:49 sena_kun left