🦋 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:16
xinming left
00:18
xinming joined
00:26
jpn joined
00:31
jpn left
00:49
constxqt_ joined
01:16
xinming left
01:18
xinming joined
02:28
jpn joined
02:31
Summer left,
Summer joined
02:33
jpn left
02:40
hulk joined
02:41
kylese left
02:46
xinming left
02:47
xinming joined
03:15
hulk left,
kylese joined
03:46
xinming left
03:48
xinming joined
04:16
xinming left
04:17
xinming joined
04:30
jpn joined
04:32
camelia left,
nine left,
nine_ joined
04:35
jpn left
04:38
camelia joined
05:37
mark22k left
05:39
mark22k joined
06:26
jpn joined
06:45
xinming left
06:47
xinming joined
06:57
jpn left
07:01
jpn joined
07:07
jpn left
07:46
xinming left
07:47
xinming joined
08:31
jpn joined
08:35
jpn left
09:05
sena_kun joined
09:15
xinming left
09:17
xinming joined
09:21
dbonnafo2 joined
09:46
xinming left
09:48
xinming joined
10:00
mscha joined
|
|||
mscha | m: enum Dir <N E S W>; my Dir %opposite{Dir} = N=>S, E=>W, S=>N, W=>E; | 10:02 | |
camelia | Type check failed in binding to parameter 'key'; expected Dir but got Str ("N") in block <unit> at <tmp> line 1 |
||
mscha | enum Dir <N E S W>; my Dir %opposite{Dir} = :N(S), :E(W), :S(N), :W(E); | ||
m: enum Dir <N E S W>; my Dir %opposite{Dir} = :N(S), :E(W), :S(N), :W(E); | |||
camelia | Type check failed in binding to parameter 'key'; expected Dir but got Str ("N") in block <unit> at <tmp> line 1 |
||
mscha | m: enum Dir <N E S W>; my Dir %opposite{Dir} = N,S, E,W, S,N, W,E; | ||
camelia | ( no output ) | ||
mscha | Is there an elegant/short syntax to create a pair that doesn't stringify the key? | 10:03 | |
10:03
araujo joined
|
|||
araujo | hello | 10:04 | |
10:32
jpn joined
10:37
jpn left
10:49
Sgeo left
|
|||
lizmat | mscha: I don't think so: Pair.new(N,S) is the shortest I could come up with | 11:00 | |
m: sub infix:<P>(\a,\b) { Pair.new(a,b) }; enum Dir <N E S W>; my Dir %opposite{Dir} = N P S, E P W, S P N, W P E | 11:04 | ||
camelia | ( no output ) | ||
lizmat | m: sub infix:<P>(\a,\b) { Pair.new(a,b) }; enum Dir <N E S W>; my Dir %opposite{Dir} = N P S, E P W, S P N, W P E; dd %opposite | ||
camelia | Hash[Dir,Dir] %opposite = (my Dir %{Dir} = Dir::N => Dir::S, Dir::E => Dir::W, Dir::S => Dir::N, Dir::W => Dir::E) | ||
lizmat | m: enum Dir <N E S W>; my Dir %opposite{Dir} = DIr::N=>S, Dir::E=>W, Dir::S=>N, Dir::W=>E; | 11:06 | |
camelia | Could not find symbol '&N' in 'GLOBAL::DIr' in block <unit> at <tmp> line 1 |
||
lizmat | m: enum Dir <N E S W>; my Dir %opposite{Dir} = Dir::N=>S, Dir::E=>W, Dir::S=>N, Dir::W=>E; | ||
camelia | ( no output ) | ||
lizmat | mscha: ^^ perhaps shorter | ||
mscha | Thanks, lizmat! | 11:07 | |
11:18
dbonnafo2 left,
dbonnafo2 joined
11:26
dbonnafo2 left,
dbonnafo3 joined
11:51
Summer left,
Summer joined
|
|||
Geth | advent/main: dc57da7869 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | raku-advent-2023/authors.md Schedule day 12 and 14 |
11:54 | |
12:15
xinming left
12:17
xinming joined
12:21
Summer left
12:22
Summer joined
13:23
Summer left,
Summer joined
13:54
Summer left,
Summer joined
|
|||
mort | does raku have some way of doing what C++ would call pure virtual methods, or what Go or Java would call interfaces | 13:57 | |
nemokosch | I suppose that would be a role with a method that has a dummy missing implementation (e.g yadda-yadda operator) | 14:18 | |
14:24
Summer left,
vrurg_ joined
14:25
Summer joined
14:27
vrurg left
14:35
vrurg joined
14:38
vrurg_ left
|
|||
Geth | advent/main: ac4c7b5d10 | ab5tract++ (committed using GitHub Web editor) | raku-advent-2023/authors.md Update authors.md |
14:43 | |
14:47
vrurg_ joined
14:50
vrurg left
14:55
Summer left,
Summer joined
14:57
mscha left
|
|||
Geth | advent/main: cce3035002 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | raku-advent-2023/authors.md Make sure holes in schedule remain |
15:24 | |
15:26
Summer left,
Summer joined
15:42
mark22k left
15:43
mark22k joined
15:56
Summer left
15:57
Summer joined
16:07
antim0d3s joined
16:09
sdfgsdfg left
16:27
Summer left,
Summer joined
16:38
jpn joined
16:43
jpn left
16:45
gdown joined
|
|||
gdown | Is there a builtin way to index multidimensional arrays by a single variable containing the index? For example: `my @idx = 1,2; [[1,2,3],[4,5,6],[7,8,9]].multidimensional-index(@idx)` => 6 | 16:48 | |
tbrowder__ | .tell lizmat i tried to comment on Q article but couldn't get the right link, but here it is: | 16:56 | |
tellable6 | tbrowder__, I'll pass your message to lizmat | ||
tbrowder__ | .tell lizmat "m | ||
tellable6 | tbrowder__, I'll pass your message to lizmat | ||
16:57
jpn joined
|
|||
tbrowder__ | .tell lizmat "notably quoteable" | 16:57 | |
tellable6 | tbrowder__, I'll pass your message to lizmat | ||
grondilu | m: my @idx = 1,2; [[1,2,3],[4,5,6],[7,8,9]][|@idx] | ||
camelia | ( no output ) | ||
grondilu | m: my @idx = 1,2; say [[1,2,3],[4,5,6],[7,8,9]][|@idx] | ||
camelia | ([4 5 6] [7 8 9]) | ||
grondilu | hum | ||
16:58
Summer left
|
|||
grondilu | m: my @idx = (1;2); say [[1,2,3],[4,5,6],[7,8,9]][|@idx] | 16:58 | |
camelia | ([4 5 6] [7 8 9]) | ||
16:58
Summer joined
|
|||
antononcube | @grondilu I also thought that slip can be used, but not so much. 🙂 One has to use 1;2 -- I am not sure how make it from a list. | 17:00 | |
@gdown Good question! One -- unelegant -- solution is to use this definition : sub multidimensional-index(@pos) { -> @a { reduce( {$^a.slice($^b).head }, @a, |@pos) } } . | 17:10 | ||
@gdown If one knows what is the actual infix operator corresponding to ; in this expression @a[1;2] , then a simple function can be defined. | 17:12 | ||
17:15
jpn left
|
|||
nemokosch | gdown: || to the rescue (will come with 6.e) | 17:20 | |
m: use 6.e.PREVIEW; my @idx = 1,2; [1,2,3],[4,5,6],[7,8,9].say | 17:21 | ||
evalable6 | Cannot test e22987f4cae5b26163a18c3e76e9fead37e601bf (Commit exists, but an executable could not be built for it) | ||
linkable6 | (2023-12-08) github.com/rakudo/rakudo/commit/e22987f4ca Simplify internal QX sub | ||
Raku eval | Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Undeclared routine: use used at line 1 (in Raku please use "v" prefix for pragma (e.g., "use v6;", "use v6.c;") instead) | ||
nemokosch | yeah damn v | ||
m: use v6.e.PREVIEW; my @idx = 1,2; [1,2,3],[4,5,6],[7,8,9].say | |||
evalable6 | Cannot test e22987f4cae5b26163a18c3e76e9fead37e601bf (Commit exists, but an executable could not be built for it) | ||
Raku eval | 6 | ||
librasteve | 🍬 | 17:23 | |
scullucs | Is that a "slip, slio"? | 17:24 | |
lucs | * slip, slip | 17:25 | |
nemokosch | I think technically it's a prefix || operator | ||
m: use v6.e.PREVIEW; my @idx = 1,2; ||@idx andthen .WHAT.say; | 17:26 | ||
evalable6 | Cannot test e22987f4cae5b26163a18c3e76e9fead37e601bf (Commit exists, but an executable could not be built for it) | ||
Raku eval | (Slip) | ||
linkable6 | (2023-12-08) github.com/rakudo/rakudo/commit/e22987f4ca Simplify internal QX sub | ||
nemokosch | only says slip | ||
I don't know how it works, to be honest | |||
m: use v6.e.PREVIEW; my @idx = 1,2; ||@idx andthen .ⅆ | |||
evalable6 | Cannot test e22987f4cae5b26163a18c3e76e9fead37e601bf (Commit exists, but an executable could not be built for it) | ||
Raku eval | slip(1, 2) | ||
17:28
Summer left
17:29
Summer joined
|
|||
librasteve | i nominate the name 'slid operator' since its a slip with extra dims | 17:36 | |
gdown | Oh, sweet! I saw that syntax in the design docs, but I assumed I misunderstood it. I didn't realize it just wasn't implemented yet | 17:42 | |
librasteve | there's a hint of what is going on here in the docs say so (1,2; 3,4) eqv ((1,2), (3,4)); | ||
lizmat | . | 17:43 | |
tellable6 | 2023-12-10T16:56:13Z #raku <tbrowder__> lizmat i tried to comment on Q article but couldn't get the right link, but here it is: | ||
2023-12-10T16:56:43Z #raku <tbrowder__> lizmat "m | |||
2023-12-10T16:57:15Z #raku <tbrowder__> lizmat "notably quoteable" | |||
librasteve | fwiw I would be interested how to mix prefix '|' and prefix '||' to handle slices in multidims | ||
lizmat | tbrowder_: not sure I understand what you're saying | 17:46 | |
antononcube | @nemokosch ''|| to the rescue (will come with 6.e)" -- Cheating!!! | 17:47 | |
17:59
Summer left,
Summer joined
|
|||
tbrowder__ | "notable quoteables" is a reference to a weekly segment on our fave news show. it features short clips of mostly celebreties saying something catchy, profound, timely, or stupid. your Q article falls in the profound and timely categories and it is definitely "quotable!" a bad pun maybe, but i couldn't resist. :-D | 18:25 | |
lizmat | aaah... ok, I'll take that as a compliment then :-) | 18:29 | |
18:30
Summer left,
Summer joined
19:00
Summer left
19:01
Summer joined
19:04
jpn joined
19:31
Summer left,
Summer joined
19:37
derpydoo joined
20:02
Summer left,
Summer joined,
jpn left
20:32
Summer left
20:33
Xliff joined
|
|||
Xliff | \o | 20:33 | |
20:33
Summer joined
|
|||
Xliff | Is there a way to emulate a character class but for multi character sets? | 20:33 | |
So I want to do something like this / <-[<>]>+ / | |||
But replacing '<' with '[%' and '>' with '%]' -- and the observant amongst you may be able to suss out the use case. :) | 20:34 | ||
20:46
derpydoo left
21:03
Summer left,
Summer joined
|
|||
tbrowder__ | lizmat: it definitely is! | 21:28 | |
21:34
Summer left,
Summer joined
21:51
kylese left
21:54
kylese joined
22:04
Summer left
22:05
Summer joined
22:09
jpn joined
22:12
Summer left
22:13
jpn left
22:16
jpn joined
22:20
jpn left
22:21
Sgeo joined
22:28
jpn joined
22:33
jpn left
22:45
sena_kun left
22:46
dbonnafo3 left
23:06
Summer joined
23:11
tadzik left
23:22
tadzik joined
|