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:18 DarthGandalf left 00:20 DarthGandalf joined 00:54 guifa_ joined 00:55 guifa left 03:30 stanrifkin_ joined 03:33 stanrifkin left 04:28 human-blip left 04:34 human-blip joined 08:53 librasteve_ joined 08:54 lizmat left 08:56 lizmat joined
davidromero55 Hi, im working in a personal project and get something confusing, Why can not declare class Foo::Bar {} inside Foo/Bar.rakumod ? or just declade class Bar {} and use as Foo::Bar.new? 15:13
antononcube Of course, you can define A::B in a file "A/B.rakumod". 15:18
.landyacht. The path where the file lives determines how you have to import it (unless you have a META6 file), but the name you give the class inside the file determines how it’s referred to once imported 18:25
So if unit class Bar lives in Foo/Bar.rakumod, you would use Foo::Bar then refer to the class as Bar e.g. Bar.new 18:26
If you want usages to require the full name, you’d declare it as class Foo::Bar 18:27
This caused a lot of grief for me as well coming from primarily C# and Java (and some Perl, but without OO) when I first started 18:28
But it offers a level of flexibility for creating nice interfaces that I appreciate now 18:29
18:37 lizmat left 18:39 lizmat joined
davidromero55 Thanks, the issue was the VSCode raku plugin showing an error, but also it compiles, looks like a bug in the VSCode Raku plugin 18:47
librasteve @.landyacht. this sounds like it should be better explained in the raku docs - would you agree … if so, perhaps raise as a quick document improvement issue …? 19:23
23:05 ACfromTX left 23:49 ACfromTX joined 23:59 ACfromTX left