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:24 tg57 joined, tg57 left 01:38 tg57 joined 01:58 tg57 left 02:03 raschip joined
elcaro oooh, Terminal::Print show-and-tell time! Here's a terminal snake game with "fancy" graphics. gist.github.com/0racle/9852f590387...6375c04840 Snake can be controlled with via WASD, HJKL, or cursor keys. Pause game with P. 02:37
03:27 raschip left
:(**@rest, *%rest) m: my ($first, %rest) = 1, 2, 3; say %rest; 07:57
Raku eval {2 => 3}
:(**@rest, *%rest) šŸ˜³
m: my ($first, %rest) = {:a, :b, :c}; say %rest; 08:01
Raku eval {a => True, b => True}
:(**@rest, *%rest) m: my ($first, %rest) = {:a, :b, :c}; say $first say %rest; 08:02
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Two terms in a row across lines (missing semicolon or comma?) at /home/glot/main.raku:3 ------> say $firstā<EOL> expecting any of: infix infix stopper postfix statement end statement modifier statement modifier loop
:(**@rest, *%rest) m: my ($first, %rest) = {:a, :b, :c}; say $first; say %rest;
Raku eval a => True {b => True, c => True}
:(**@rest, *%rest) when assignment signatures do different than function signatures šŸ˜” 08:06
08:06 snonux_ left, snonux left
CIAvash if you want it to act like function signatures, then you should use binding(:=), not assignment 09:04
09:19 dakkar joined
Nemokosch very cool stuff! 09:41
09:55 Manifest0 joined
elcaro Thanks 09:59
Nemokosch Terminal::Print could also "get a life", again 10:03
what I'm really curious about for low-level terminal handling is this github.com/Bill-Gray/PDCursesMod 10:06
sometimes one just has to deal with Windows
for example because of colleagues who only use that... 10:07
10:37 dakkar left 11:17 dakkar joined 12:45 lizmat_ joined 12:47 RakuIRCLogger left 12:48 lizmat left 12:49 MasterDuke left 12:53 ab5tract joined
Skarsnik MS push to use the Terminal app now that support lot of thing 13:21
Nemokosch yes, it's like, they do have working choices by now, but it's too often not available still 13:46
:(**@rest, *%rest) does anyone knows why my super implementation doesn't work glot.io/snippets/ghoxb47ub4 13:48
should give this output A.a is called B.a is called 13:49
Nahita Super.new(o => $o); can't initialize a private attribute with that 13:52
it's private 13:53
has $!o is built; might help
to initialize
or has $.o as usual 13:54
:(**@rest, *%rest) oh nice now it worked glot.io/snippets/ghoxb47ub4 13:55
Nahita FWIW, callsame will do too 13:57
Nemokosch I think the problems with callsame arise once you had multiple candidates by argumentation 14:16
like, callsame is perfectly happy to redispatch to a less specific candidate on the same class 14:17
:(**@rest, *%rest) super avoids that 14:18
14:24 lizmat_ left, lizmat joined 14:58 tg57 joined 15:51 ab5tract left 15:52 ab5tract joined 17:24 tg57 left 17:39 tg57 joined 17:40 dakkar left
tg57 I just started learning Raku and was wondering if anyone had good suggestions for practice projects 17:40
18:28 tg57 left 18:55 NemokoschKiwi joined, NemokoschKiwi left
Nemokosch I think it very much depends on what you'd like to learn/achieve 19:15
something with text processing? something about making a port of an existing thing? playing around with some algorithm? some TUI fun like elcaro posted yesterday (mini snake game)? 19:19
19:39 snonux joined 19:40 snonux_ joined 19:48 snonux_ left 19:49 snonux left 19:54 tg57 joined 19:57 raschip joined 20:34 snonux joined 20:35 snonux_ joined 20:48 raschip left
nHail This code should be printing the tick onto the screen in ncurses every 0.5 seconds, but I'm not seeing any output. What's going on? I tried a similar thing with say and no ncurses, and it did print every half second as expected. perl my $tickSupply = Supply.interval(0.5); $tickSupply.tap(-> $v { mvaddstr(1, 1, $v); nc_refresh; }); 21:12
ab5tract perl? 21:18
I think you want to wrap that in a react { whenever $tickSupply -> $v { #current tap code } } 21:19
Nemokosch You yourself imply that this is a problem related to ncurses. It's probably not a "beginner question", or even a question that most people have a chance to answer
nHail That's to mark the syntax highlighting lang in discord. There's no raku option so I told it to use perl 21:20
Well, now it's at least giving me an error message 21:23
This type cannot unbox to a native string: P6opaque, Int
thrown on the mvaddstr line 21:24
Nahita $v is integer? 21:25
oh it's a parameter there
i don't know supplies so i shouldn't clutter here
but mvaddstr seems to expect string as its last parameter there 21:26
nHail Okay, I figured it out 21:28
I had a react block earlier in the program which killed the program when I pressed q 21:29
From the docs: > a react block runs where it appears in the code flow
Nemokosch yes; unlike a supply block 21:30
ab5tract yeah, there's that. glad you got it sorted 21:45
22:30 snonux left, snonux_ left 22:44 ab5tract left 22:51 NemokoschKiwi joined, NemokoschKiwi left, NemokoschKiwi joined 22:54 tg57 left 23:25 NemokoschKiwi left