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.
Yeuph hey I'm struggling with something 00:10
this won't work
class IsEven { has $.num; method CheckEven { if ($.num % 2 = 0) {say 'Is Even';} else {say 'Is Odd';} } } 00:11
keep getting "Cannot modify immutable Int"
what bit of logic am I missing here?
00:29 Manifest0 left
rf it should be == 0 01:16
not = 2 @Yeuph
not = 0**
Yeuph yeah... 01:17
I forgot this beams into the other text channel
I humiliatedly deleted my text hoping no one had seen it after I saw it lol 01:18
rf Also for the first part, I'm fairly certain that doesn't work :)
Yeuph lol
rf Well, not as you think it works
Yeuph I arrived there after 30 minutes of trying to figure out why my program wouldn't work 01:19
and no, that doesn't work either lol
rf m: say %(5, 2);
camelia {5 => 2}
Yeuph ya, looks like some functional thing
rf It's actually a map. 01:20
Yeuph When I tried that I did get the program to work
except not how I wanted to
so I came in here asking what was going on because that didn't make sense to me either
rf %(n, m) should always be truthy so it would always hit the truthy block 01:21
m: say %(5, 2)<5>;
camelia 2
Yeuph Thanks for chiming in. I'm gonna get back to my book. All of humanity was just killed, very exciting. I guess I'm rooting for the spiders now (Children of Time) 01:22
rf Haha, enjoy! 01:23
02:12 rf left
el gatito (** advocate) m:perl class C { method !hi { say 'hi' } } say 'hello'; C.!hi; 04:20
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Malformed postfix call at /home/glot/main.raku:8 ------> C.⏏!hi;
el gatito (** advocate) m:perl class C { method !hi { say 'hi' } method hiya { self.!hi } } say 'hello'; C.hiya; 04:22
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Malformed postfix call at /home/glot/main.raku:6 ------> self.⏏!hi
el gatito (** advocate) !method is private because of syntactic restriction
bruh 04:23
m:perl class C { method !hi { say 'hi' } method hiya { !hi } } say 'hello'; C.hiya;
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Undeclared routine: hi used at line 6
el gatito (** advocate) m:perl class C { method !hi { say 'hi' } method hiya { !hi() } } say 'hello'; C.hiya;
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Undeclared routine: hi used at line 6
el gatito (** advocate) turns out i got the syntax wrong 04:25
m:perl class C { method !hi { say 'hi' } method hiya { self!hi } } say 'hello'; C.hiya;
Raku eval hello hi
el gatito (** advocate) m:perl class C { method !hi { say 'hi' } } say 'hello'; C!hi;
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Calling private method 'hi' must be fully qualified with the package containing that private method. at /home/glot/main.raku:8 ------> C!hi⏏; expecting any of: method arguments
el gatito (** advocate) anyways new documentation ui 04:26
cdn.discordapp.com/attachments/768..._Opera.jpg
tenor.com/view/moist-critical-gif-18538102 04:34
07:48 ab5tract left
Nemokosch AlexDaniel mocked it 😩 07:54
el gatito (** advocate) is a class object just an instance of the class itself 08:15
m:perl class C {} say C.WHAT; 08:19
Raku eval (C)
el gatito (** advocate) the class of class C is C itself
mind blown
lizmat yes 09:00
el gatito (** advocate) the reason why class methods are not separated from instance methods is because classes are just instances of itself 09:09
so instance methods are applicable to class 09:10
Nemokosch in Python land: "static method" = sub inside of class, "class method" = method invoked on a class instance, "object method" (does it even have a name) = method invoked on a concrete instance 09:14
el gatito (** advocate) object method is called instance method in python (and most otger languages as well) 09:18
the class isn't even responsible for creating instances unlike python and ruby the metaobject is 09:23
Nemokosch a class corresponds to a metaobject, for what it's worth 09:24
one could say that the class is the syntactic representation while the metaobject is the (runtime) behavior 09:27
el gatito (** advocate) meanwhile in python the class is the metaobject lol 09:30
Nemokosch that's a blessing and a curse at the same time 09:38
more stable APIs -> safer and easier to work with BUT more burden on the implementations, therefore one needs to give up on own speed 09:40
12:10 ab5tract joined 12:46 human-blip left 13:46 Heptite left 14:28 jgaz joined 14:41 Heptite joined 14:50 rf joined 14:53 CIAvash left 15:57 CIAvash joined 16:06 ab5tract left 16:27 lizmat_ joined 16:32 lizmat_ left 16:33 lizmat_ joined 16:36 rf left, lizmat left 16:37 rf joined 16:46 lizmat_ left 16:47 lizmat joined
nHail Is there a way to turn a junction into a list? I saw iterator, but that seems too complicated 19:05
19:21 MasterDuke joined
Nemokosch I think "officially" there isn't, de facto it's possible 19:43
raku.land/zef:lizmat/eigenstates 19:44
20:27 Guest9849 joined 20:31 Guest9849 left, Guest5811 joined 21:11 Guest5811 left 21:16 shmup left 22:09 rf left 22:12 shmup joined 22:29 Guest5811 joined 22:44 Guest5811 left 23:00 rf joined, Guest5811 joined 23:10 Guest5811 left 23:11 Guest8070 joined, Guest8070 is now known as tg57 23:30 NemokoschKiwi joined 23:46 tg57 left