This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:16
jgaz left
|
|||
guifa | not a regex | 00:36 | |
^5 is equivalent to 0 .. 4 | |||
m: .say for ^5 | |||
camelia | 0 1 2 3 4 |
||
guifa | The idea is that 0 to $x - 1 is a super common range that people use, especially in for loops. for ^5 { … } loops exactly five times | 00:37 | |
01:31
Kaiepi left
|
|||
pelevesque | Does anyone know how to define an operator with two variants at once. I have a ♩PM operator, but also want to allow QNPM (quarter-notes per minute). I tried the following code, but it failed: | 06:15 | |
```sub postfix:<♩PM|QNPM>($n) { (60000000 / $n).floor }; say 60QNPM; | |||
Does anyone know how to define an operator with two variants at once. I have a ♩PM operator, but also want to allow QNPM (quarter-notes per minute). I tried the following code, but it failed: | |||
sub postfix:<♩PM|QNPM>($n) { (60000000 / $n).floor }; say 60QNPM; | |||
Does anyone know how to define an operator with two variants at once. I have a ♩PM operator, but also want to allow QNPM (quarter-notes per minute). I tried the following code, but it failed: | |||
``` | |||
sub postfix:<♩PM|QNPM>($n) { (60000000 / $n).floor }; say 60QNPM; | |||
``` | |||
06:44
discord-raku-bot left
|
|||
guifa | pelevesque: you'll have to define them separately | 08:44 | |
09:18
dakkar joined
09:19
discord-raku-bot joined
09:23
discord-raku-bot left
09:26
gfldex joined
10:01
Kaiepi joined
|
|||
SmokeMachine | m: sub postfix:<♩PM>($n) { (60000000 / $n).floor }; sub postfix:<QNPM>($n) { $n♩PM }; say 60QNPM | 10:21 | |
camelia | 1000000 | ||
SmokeMachine | m: sub postfix:<♩PM>($n) { (60000000 / $n).floor }; my &postfix:<QNPM> := &postfix:<♩PM>; say 60QNPM | 10:23 | |
camelia | 1000000 | ||
SmokeMachine | pelevesque: I think that's the closest way of doing it at once ☝️ | 10:27 | |
17:02
dakkar left
23:58
gfldex left
|