🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:07 reportable6 left 00:49 slowtyper left 00:50 slowtyper joined 01:08 reportable6 joined 01:14 dynamite left 01:24 hasrthur joined, squashable6 left 01:25 squashable6 joined 01:28 hasrthur left 01:30 dynamite joined 01:35 Kaiepi left 02:16 archenoth left, archenoth joined 02:25 tejr left 02:27 tejr joined 02:30 dynamite left 02:41 dynamite joined 02:49 razetime joined 02:51 dynamite left 03:35 djerius_ joined 03:36 djerius left, dynamite joined 04:26 frost joined
[Coke] m: my Int \z = 42; z :=100; 04:43
camelia ===SORRY!=== Error while compiling <tmp>
Cannot bind to 'z' because it is a term and terms cannot be rebound
at <tmp>:1
------> my Int \z = 42; z :=100⏏;
[Coke] m: my Int \z = 42; z := 'x'
camelia ===SORRY!=== Error while compiling <tmp>
Cannot bind to 'z' because it is a term and terms cannot be rebound
at <tmp>:1
------> my Int \z = 42; z := 'x'⏏<EOL>
[Coke] bisectable6: m: my Int \z = 42; z :=100;
bisectable6 [Coke], Will bisect the whole range automagically because no endpoints were provided, hang tight
[Coke], Output on all releases: gist.github.com/9e5f2e2e374e302da6...eb92ed5af9 04:44
[Coke], Bisecting by exit code (old=2021.10 new=2021.12). Old exit code: 0
[Coke], bisect log: gist.github.com/2fb27de4ecf106e956...b914c00cbe
[Coke], (2021-11-07) github.com/rakudo/rakudo/commit/90...6f5f6711d1
[Coke], ⚠ New output detected, please review the results manually
[Coke], Output on all releases and bisected commits: gist.github.com/6f770a2858b5477de4...81e4e067e6
04:46 frost left 04:47 sena_kun left
Geth ¦ doc: coke assigned to JJ Issue doc/Type/Signature.pod6 fails make xtest github.com/Raku/doc/issues/4012 04:51
04:57 sena_kun joined 05:01 frost joined 05:04 lichtkind joined 05:18 squashable6 left 05:19 squashable6 joined 05:26 frost15 joined, frost15 left, frost21 joined 05:27 frost21 left, frost31 joined 05:29 frost left 05:30 frost31 is now known as frost 05:41 frost left 05:46 leedo left, leedo joined 05:48 jcallen_ left 05:49 jcallen joined 05:55 frost joined 06:02 mexen joined 06:07 ph88 left, ph88 joined, reportable6 left 06:08 reportable6 joined 06:22 kjp left, kjp joined 06:23 ph88 left, ph88 joined 06:24 dynamite left 06:34 Sgeo left 06:42 lichtkind left 07:04 abraxxa joined 07:10 abraxxa left 07:11 abraxxa joined 07:12 razetime left 07:18 ufobat joined 07:19 frost left, seednode99 left, seednode99 joined 07:30 frost joined 07:44 ph88 left 07:45 ph88 joined, frost left 07:47 abraxxa left 07:49 ph88 left 07:50 ph88 joined 07:51 abraxxa-home joined 08:37 lucs_ left 08:42 kjp left 08:46 lucs joined, kjp joined 08:57 ph88 left, ph88 joined 09:20 kjp left 09:21 kjp joined 09:46 lucs left 09:47 lucs joined 10:18 dynamite joined 10:20 hasrthur joined 11:12 Geth left, Geth joined 11:18 lichtkind joined 11:54 abraxxa-home left 12:05 jjido joined 12:07 reportable6 left, reportable6 joined
tbrowder howdy, question for experts: given an object '$s', is it possible to create Raku methods to return a single value using these two syntaxes: '$s<a>' and '$s[1;2]'? 12:43
to be clear, each method should return one value 12:45
the object is an array 12:46
rather the object has an array as one attribute 12:47
i'm thinking that if i define an operator like <> or [] inside the class it might work somehow magically if done properly...or with a role... 13:03
13:07 linkable6 left, evalable6 left 13:08 jjido left
tbrowder hm, '$s.<>' or '$s.[]'... 13:09
or '$s.cell<>' or '$s.cell[]' 13:10
El_Che tbrowder: you're a busy bee :) 13:12
13:15 lichtkind left
Voldenet I'm not an expert, but 13:17
m: sub postcircumfix:<{ }>(@container, **@key) { 42 }; my $s = []; $s<a>.say
camelia 42
Voldenet it ruins the operator in the process though 13:19
m: augment class Array { multi method AT-KEY(Array:D: $key) is raw { 42 } }; my $s = []; $s<a>.say; 13:30
camelia ===SORRY!=== Error while compiling <tmp>
augment not allowed without 'use MONKEY-TYPING'
at <tmp>:1
------> augment class Array⏏ { multi method AT-KEY(Array:D: $key) is
expecting any of:
generic role
Voldenet m: use MONKEY-TYPING; augment class Array { multi method AT-KEY(Array:D: $key) is raw { 42 } }; my $s = []; $s<a>.say;
camelia 42
13:31 kjp left 13:32 kjp joined 13:34 jjido joined
Voldenet m: role Nice { multi method AT-KEY(Array:D: $key) is raw { 42; } }; my $s = [] but Nice; $s<a>.say 13:36
camelia 42
lizmat tbrowder: is the object of a class of your own making?
Voldenet Nice.
lizmat tbrowder ^^
13:47 frost joined 13:54 jjido left 14:09 evalable6 joined 14:12 Util joined 14:15 frost left 14:18 kjp left 14:30 frost joined 14:43 frost left
[Coke] m: .say for $*ARGFILES.lines; 14:44
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] m: use v6.d; .say for $*ARGFILES.lines; 14:45
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] m: use v6.d; sub MAIN() {.say for $*ARGFILES.lines;}
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
[Coke] ... why is this not working locally? Weird.
*FACEPALM*. because I already have a script with this handy short name earlier in my PATH. You would think I had learned this lesson by now. 14:46
14:47 morte_ joined 14:55 euandreh left, Guest40 joined
Guest40 Hi 14:56
lizmat Guest40 o/
14:57 euandreh joined
guifa Voldenet: just make it a multi; multi sub postcircumfix:<{ }>(@, **@) { … } 15:04
15:04 Geth left, Geth joined 15:08 dynamite left, dynamite joined 15:09 linkable6 joined 15:24 Sgeo joined 15:25 Guest40 left 15:27 morte_` joined 15:29 morte_` left 15:30 morte_ left, kjp joined 15:37 dynamite left 16:37 linkable6 left, evalable6 left 16:38 linkable6 joined, evalable6 joined 16:44 eseyman left
tonyo you don't really need the `but` in there, this'll work fine too 17:02
m: role X { multi method AT-KEY($k) { $k }; }; my $l = X.new; say $l<a>; say $l<b>;
camelia a
b
tonyo the [X;Y] syntax would require some grammar 17:13
17:25 mexen left 17:32 jjido joined
tbrowder .tell lizmat yes, my class 17:40
tellable6 tbrowder, I'll pass your message to lizmat
lizmat tbrowder: then add an AT-KEY method to it 17:41
17:41 dogbert11 joined
lizmat m: class A { method AT-KEY($key) { say "fetching $key" } }; my $a = A.new; $a<foo>' 17:42
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> tching $key" } }; my $a = A.new; $a<foo>⏏'
expecting any of:
infix
infix stopper
statement end
statement …
lizmat m: class A { method AT-KEY($key) { say "fetching $key" } }; my $a = A.new; $a<foo>
camelia fetching foo
17:43 dogbert17 left
tbrowder ok, thnx, enough to experiment with. thnx Voldenet 17:43
17:54 djerius_ left 17:56 djerius joined 18:07 reportable6 left
tonyo AT-POS can be done in a similar way but requires a little more fanagling 18:11
tbrowder and lizmat 18:32
and tonyo
tonyo m: role X { multi method AT-KEY($k) { $k }; multi method AT-POS(X: Int:D \p) { "{p + 1}"; }; }; my $l = X.new; say $l<a>; say $l<b>; say $l[1, 2]; 18:35
camelia a
b
(2 3)
tonyo AT-POS is called twice in that pattern ^
Geth examples: sdondley++ created pull request #93:
solution for prob17
18:54
18:56 ph88 left 19:08 jjido left 19:09 reportable6 joined 19:32 getimiskon joined 20:01 dustinm`_ left 20:12 dustinm` joined 20:19 getimiskon left 20:21 getimiskon joined 20:56 ufobat left 20:57 ufobat joined 21:57 linkable6 left, evalable6 left 21:59 evalable6 joined 22:13 jaguart left 22:32 Geth left, Geth joined 22:36 Geth left, Geth joined 22:41 Geth left, Geth joined 23:11 ufobat left 23:12 getimiskon left
Geth examples: sdondley++ created pull request #94:
solution for problem #6
23:15