🦋 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.
Xliff Can you pun more traits to a class-instances attribute object at run-time? 01:34
m: class A { $.a }; trait_mod:<is>(A.^attributes.head, :rw)
camelia ===SORRY!=== Error while compiling <tmp>
Variable $.a used where no 'self' is available
at <tmp>:1
------> class A { $.a⏏ }; trait_mod:<is>(A.^attributes.head, :
expecting any of:
term
Xliff m: class A { has $.a }; trait_mod:<is>(A.^attributes.head, :rw) 01:35
camelia ( no output )
Xliff m: class A { has $.a }; trait_mod:<is>(A.^attributes.head, :rw); my $a; $a.a = 2; $a.gist.say
camelia No such method 'a' for invocant of type 'Any'
in block <unit> at <tmp> line 1
Xliff m: class A { has $.a }; sub trait_mod:<is> (Attribute \at, :$foo is required) { say "Foo!" }; trait_mod:<is>(A.^attributes.head, :foo); my $a; $a.a = 2; $a.gist.say 01:36
camelia Foo!
No such method 'a' for invocant of type 'Any'
in block <unit> at <tmp> line 1
Xliff m: class A { has $.a }; role B { method a { say "A" } }; sub trait_mod:<is> (Attribute \at, :$foo is required) { say "Foo!"; a does A}; trait_mod:<is>(A.^attributes.head, :foo); my $a; $a.gist.say 01:37
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routines:
a used at line 1
does used at line 1
Xliff m: class A { has $.a }; role B { method a { say "A" } }; sub trait_mod:<is> (Attribute \at, :$foo is required) { say "Foo!"; at does A}; trait_mod:<is>(A.^attributes.head, :foo); my $a; $a.gist.say 01:38
camelia Foo!
Cannot mix in non-composable type A into object of type Attribute
in sub trait_mod:<is> at <tmp> line 1
in block <unit> at <tmp> line 1
melezhik . 09:27
Geth Raku-Steering-Council/main: 488cfb25b8 | (Elizabeth Mattijsen)++ | minutes/20230826.md
Add RSC meeting minutes for 2023-08-26
09:33
wayland76 Hi! I'm making some objects and pushing them into a list, but I want to avoid duplicates (ie. the exact same object being in the list twice). Does anyone have any tips for me on how to find out if a particular object is already in a list? 10:28
lizmat docs.raku.org/type/independent-rou...ine_unique 10:29
lizmat so what you'd basically do, is to push to the array, and then run .= unique on it 10:29
or if your objects can be part of a Seq, it could be something like 10:30
my @unique-objects = objects.producer.unique
wayland76 Thanks! Very useful. That helped me find the answer I used: if (not $dfn ∈ @!nodes) { @!nodes.push: $dfn; } 10:33
lizmat wayland76 there's also docs.raku.org/language/operators#infix_∉ 10:47
lizmat And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/08/28/2023-...ferencing/ 11:09
El_Che 09-moar/01-profilers.t has been extremly flappy on the last release 12:07
tbrowder__ ++lizmat 12:11
Xliff What editor is everyone using for Raku coding? 13:06
tbrowder__ emacs and vi 14:20
japhb Emacs 14:29
El_Che no Comma users here? 14:49
TieUpYourCamel I use eclipse 14:54
El_Che rakudo-pkg v2023.03 released github.com/nxadm/rakudo-pkg/ 15:04
rakudo-pkg v2023.08 released github.com/nxadm/rakudo-pkg/ 15:05
:)
tonyo vim 16:52
the one true editor. 16:53
tbrowder__ El_Che: thanks 20:16