🦋 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:04
yewscion left
00:06
yewscion joined
|
|||
ab5tract | Cro::Template is a common one | 00:28 | |
there is a Mustache module as well | |||
raku.land/?q=template | 00:29 | ||
00:34
yewscion left
00:35
yewscion joined
00:44
yewscion left
00:45
yewscion joined
00:57
librasteve_ left
00:59
yewscion left
|
|||
Xliff | There's alsol Template6 | 01:03 | |
Which is a raku port of Perl's Template Toolkit | |||
01:03
Xliff left
01:04
Guest64 left
01:12
yewscion joined
01:16
kjp left
|
|||
SmokeMachine | I like Cro template with Cromponent… | 01:17 | |
01:17
kjp joined
01:20
kjp left,
kjp joined
01:26
yewscion left,
yewscion joined
01:35
yewscion left,
yewscion joined
01:41
kylese left,
hulk joined
01:45
yewscion left,
yewscion joined
01:52
donaldh left
01:55
yewscion left,
yewscion joined
02:00
avuserow joined
02:04
yewscion left
02:06
yewscion joined
02:15
hulk left,
kylese joined,
yewscion left
02:16
yewscion joined
|
|||
thowe | is there something that works like Mojo's ep? | 02:29 | |
02:34
yewscion left
02:35
yewscion joined
02:54
yewscion left
02:55
yewscion joined
|
|||
thowe | Ah, Template::Mojo | 03:01 | |
03:04
yewscion left
03:06
yewscion joined
03:21
Aedil joined
03:34
yewscion left
03:35
yewscion joined
03:42
oodani left
03:44
yewscion left
03:45
yewscion joined,
oodani joined,
kylese left
03:49
kylese joined
03:58
donaldh joined
04:25
yewscion left
04:26
yewscion joined
04:32
cleo joined
04:44
yewscion left
04:45
yewscion joined
05:00
jmcgnh left
05:04
yewscion left
05:05
yewscion joined
05:06
jmcgnh joined
05:30
yewscion left
05:39
yewscion joined
05:54
yewscion left,
yewscion joined
06:02
Sgeo left
06:04
yewscion left
06:06
yewscion joined
06:25
yewscion left
06:26
yewscion joined
06:45
yewscion left,
yewscion joined
06:49
yewscion left
06:50
yewscion joined,
topnep_ joined
06:53
topnep left
06:55
yewscion left,
yewscion joined
07:04
yewscion left
07:06
yewscion joined
07:23
yewscion left
07:26
yewscion joined
07:44
yewscion left
07:45
yewscion joined
07:53
wayland joined
07:59
yewscion left
08:00
yewscion joined,
swaggboi left
08:01
swaggboi joined
08:05
yewscion left,
yewscion joined
08:10
dakkar joined
08:14
yewscion left
08:15
yewscion joined
08:24
yewscion left
08:25
yewscion joined
08:44
yewscion left
08:45
yewscion joined
08:54
topnep_ left
08:55
topnep joined
09:03
yewscion left
09:06
yewscion joined
09:15
lichtkind joined
09:24
yewscion left
09:25
yewscion joined
09:53
yewscion left
09:54
yewscion joined
10:04
yewscion left
10:06
yewscion joined
10:35
yewscion left,
yewscion joined
10:44
yewscion left
10:45
yewscion joined
10:56
yewscion_ joined
10:57
yewscion left
10:59
thundergnat joined
|
|||
thundergnat | <Xliff> I was hoping for a Raku interface to `file`Â -- Maybe take a look at raku.land/zef:thundergnat/Filetype::Magic ? | 11:00 | |
11:00
thundergnat left
11:04
yewscion_ left
11:06
yewscion joined
11:23
yewscion left
11:26
yewscion joined
11:44
yewscion left
11:45
yewscion joined
11:54
yewscion left,
yewscion joined
12:04
yewscion left
12:06
yewscion joined
12:25
yewscion left
12:26
yewscion joined
|
|||
wayland | Does anyone have tips for how to get zef installed on the docker nightly builds? | 12:30 | |
12:35
yewscion left
12:36
yewscion joined
12:46
yewscion left,
yewscion joined
12:47
ACfromTX left
13:00
ACfromTX joined
13:02
librasteve_ joined
13:04
yewscion left,
topnep left
|
|||
librasteve | wayland: I have made a set of Dockerfiles for my projects (mainly I wanted a full Numpy Python Jupyter stack for Dan::Pandas) - you are welcome to plunder for good info though I have not updated in a while github.com/librasteve/raku-Dockerfiles | 13:05 | |
13:06
yewscion joined,
topnep joined
13:35
yewscion left
13:36
yewscion joined
13:46
yewscion left,
yewscion joined
13:55
yewscion left
13:56
yewscion joined
14:06
yewscion left
14:07
yewscion joined
14:15
yewscion left,
yewscion joined
14:25
yewscion left,
yewscion joined
|
|||
ab5tract | wayland: the brute force way is to clone the repo and install manually | 14:38 | |
14:40
yewscion left,
yewscion joined
14:44
LainIwakura joined
14:46
jgaz joined
14:51
yewscion left,
yewscion joined
14:56
yewscion left,
yewscion joined
15:01
yewscion left
15:02
yewscion joined
15:04
LainIwakura left
15:07
yewscion left
15:10
topnep left
15:11
topnep joined
15:13
LainIwakura joined
15:21
librasteve_ left
15:38
yewscion joined
15:47
yewscion left
15:50
yewscion joined
16:34
dakkar left
16:43
Guest81 joined,
Guest81 left,
Comput1 joined
16:47
Comput1 left
17:15
topnep left
17:16
topnep joined
17:24
librasteve_ joined
|
|||
librasteve | hi! I came across this line of code my $cont = $tmpl.globals.escape.($t.text); | 17:25 | |
can anyone tell me what the . after espace is doing and how I can write my own method escape and pass in $t.text please? | 17:26 | ||
timo | m: sub returned-thing($arg?) { say "returned-thing was called with ", $arg }; sub create-it($arg?) { say "create-it was called with ", $arg; }; say "first, without the dot:"; create-it("hi"); say "second, with the dot:"; create-it.("hi") | 17:38 | |
camelia | first, without the dot: No such method 'CALL-ME' for invocant of type 'Bool' in block <unit> at <tmp> line 1 create-it was called with hi second, with the dot: create-it was called with (Any) |
||
timo | haha i forgot to return returned-thing | ||
m: sub returned-thing($arg?) { say "returned-thing was called with ", $arg }; sub create-it($arg?) { say "create-it was called with ", $arg; return &returned-thing }; say "first, without the dot:"; create-it("hi"); say "second, with the dot:"; create-it.("hi") | |||
camelia | first, without the dot: create-it was called with hi second, with the dot: create-it was called with (Any) returned-thing was called with hi |
||
timo | as you can see, the . after ".escape" means instead of calling the escape method with $t.text it's getting something from the ".escape" method that is then called with "$t.text" as its argument | 17:39 | |
17:40
LainIwakura left
|
|||
timo | you will find this used often when a class has an attribute that's callable, for example when there's like "hooks" or "callbacks" you can assign; `$thingie.when-light-turned-off = -> { say "hey who turned off the lights?" }; $thingie.when-light-turned-off.()` | 17:40 | |
17:41
yewscion left
|
|||
librasteve | timo: thanks ... will try | 17:44 | |
timo | for clarity you can also write that as `$thingie.when-light-turned-off()()` or `$thingie.when-light-turned-off().()` | ||
librasteve | ok - that's a new superpower (to me) - awesome (but scary) | 17:50 | |
timo | it's not always the best thing, especially since with "attribute that has callable values" you can only have one to put in there | 17:56 | |
often it's better to have a Supply returned from a method, since then code can use .tap on the supply, use it in a react/whenever or supply/whenever construct, or do any of the things you can do when you have a supply | 17:57 | ||
librasteve | ok - got my stub working ... thanks for the help!! | 17:58 | |
timo | NP | 17:59 | |
18:03
yewscion joined
18:18
PipStuart joined
18:29
yewscion left
18:37
yewscion joined
18:41
yewscion left
|
|||
SmokeMachine | About the grep discussion, I was thinking something like this glot.io/snippets/h87e0fpqlu | 18:43 | |
18:44
yewscion joined
18:54
yewscion left
18:57
yewscion joined
|
|||
Voldenet | you can use () to write numbers in a very elegant way | 18:58 | |
m: sub x { state $huh; -> { say ++$huh; x } }; x()()()()()() # 6 | 18:59 | ||
camelia | 1 2 3 4 5 |
||
librasteve | hey you reinvented binary - but inefficient | ||
Voldenet | It's awesome, the code above has mit license, feel free to use it in all your projects :^) | 19:01 | |
I can trade some efficiency for looking awesome | |||
librasteve | lol | 19:02 | |
Voldenet | it was counting wrong, but aforementioned .() can fix it | 19:08 | |
m: sub x { state $huh; -> { say ++$huh; x } }; x.()()()()()() # 6 | |||
camelia | 1 2 3 4 5 6 |
||
librasteve | bad news - this is not even binary since you are only counting ()s | 19:09 | |
Voldenet | yes, it's unary | ||
librasteve | nullary | 19:10 | |
Voldenet | ()ary | ||
ab5tract | SmokeMachine: That feels an awaful lot like regular map, though | ||
I'm glad we are talking about this though,... aybe needs a problem solving ticket | 19:11 | ||
imo, it should just produce the same output shape as its input shape | 19:12 | ||
19:16
yewscion left
19:20
topnep left
19:21
topnep joined
19:26
yewscion joined
19:31
yewscion left
19:38
yewscion joined
|
|||
timo | just a skip and a hop away from church ordinals | 19:49 | |
19:54
librasteve joined
|
|||
librasteve | test | 19:55 | |
timo | greetings steve | 19:57 | |
librasteve | time to learn tmux ;-) | 19:59 | |
+ irssi | |||
20:04
librasteve left
20:08
yewscion left,
yewscion joined
|
|||
Voldenet | librasteve: consider weechat | 20:20 | |
tellable6 | Voldenet, I'll pass your message to librasteve | ||
20:38
wayland left,
wayland joined
20:58
wayland left
20:59
wayland joined,
yewscion left
|
|||
refactus | gist.github.com/raiph/849a4a9d8875...b2eda89296 just hit the front page of lobsters | 21:22 | |
21:25
topnep left
21:27
topnep joined
|
|||
librasteve | nice … if someone would be kind enough invite me to join lobste.rs i would love to upvote it | 21:30 | |
tellable6 | 2025-06-11T20:20:01Z #raku <Voldenet> librasteve: consider weechat | ||
librasteve | to | 21:37 | |
SmokeMachine | ab5tract: sorry, what do you mean that looks like map? | 21:38 | |
On my suggestion it would alway return the same shape as entered… | 21:39 | ||
ab5tract | but only because you are manually shaping it, no? | ||
there should only be a single predicated in a grep block | |||
*predicate | |||
SmokeMachine | No… it would only test each item… it on a iteration it is getting X items, it would run X tests on each iteration (and return X values) | 21:41 | |
ab5tract | I don't see the utility in that, what's the advantage of doing that same thing one at a time? | 21:42 | |
SmokeMachine | github.com/rakudo/rakudo/issues/58...2963639208 | ||
ab5tract | *over doing that one at a time | ||
SmokeMachine | Because you can accept (or not) the first based on the second, for example… | 21:43 | |
ab5tract | It onlky makes sense to me if it is still a yes/no per batch | ||
but that's inter-batch stuff you are proposing, not batch-to-batch | |||
I see that example as just a straightforward use case for map, not a great way to think of filter | 21:44 | ||
perfectly supported by the existing map implementation, I mean | 21:45 | ||
SmokeMachine | like: `(1,3,2,4,5,1).grep: -> $a, $b { $a < $b }`, for example would return (1, 2) | ||
ab5tract | agreed | 21:46 | |
SmokeMachine | But all grep options are supported by map… | ||
21:46
librasteve_ left
|
|||
SmokeMachine | And: `(1,3,2,4,5,1).grep: -> $a, $b { $a < $b, True }`, for example could return (1, 3, 2, 4, 1) | 21:47 | |
ab5tract | I don't like that at all | 21:48 | |
either the output shape always matches the block signature shape or we haven't addressed the underlying issue at all | |||
remember this is an attempt to address a WATY | 21:49 | ||
*WAT | |||
in those cases, we should really be focusing on the absolute conceptually simplest solution | 21:50 | ||
SmokeMachine | That’s the thing… I don’t think the grep output should match the block signature, but the list entered… grep should only filter item imho… | ||
21:50
lichtkind left
21:56
librasteve joined
22:01
librasteve left
22:04
jjido joined
|
|||
Voldenet | that post is on KnowHOW is nice, but edumentab.github.io/rakudo-and-nqp...ls-course/ is a true gem | 22:07 | |
(the post links to it) | |||
22:18
yewscion joined
22:19
librasteve joined
|
|||
ab5tract | SmokeMachine: that's a major change from the current implementation. even if we changed it to be about the "list entered", I'd argue that only one element at a time should be processed. this can be destructured by the signature | 22:22 | |
mostly I agree with that, but the performance issues are too big for major use cases like .kv | 22:23 | ||
22:23
yewscion left
|
|||
ab5tract | SmokeMachine: if it should only filter an item, why are you using signatures with multiple args and blocks with multiple predicates? | 22:24 | |
22:24
librasteve left
|
|||
SmokeMachine | ab5tract: that what I meant, I think that it should accept block expecting a single argument, but if it should accept multiple arguments my suggestion is the only way it would make sense in my mind… | 22:26 | |
ab5tract | ah, gotcha, fair enough. | ||
22:38
yewscion joined
22:42
yewscion left
22:48
tedszy joined
22:52
librasteve joined
22:55
yewscion joined
22:56
librasteve left
22:59
yewscion left
23:11
wayland left
23:12
yewscion joined
23:16
yewscion left
23:21
librasteve joined
23:22
Sgeo joined
23:25
librasteve left
23:38
librasteve joined
23:43
librasteve left
23:56
librasteve joined
|