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:57 kjp left 00:59 kjp joined 01:24 camelia left 01:25 camelia joined 02:12 Kaipei left 04:33 Heptite left 06:21 kjp left 06:34 kjp joined 06:40 kjp left, kjp joined 08:02 Kaipei joined 08:52 razetime joined 09:13 habere-et-disper joined
habere-et-disper Hello rakoons o/ 09:16
What's the meaning of `1 => 2 => 3` ?
A nested pair?
Flat doesn't seem to un-nest it?
lizmat as you said, it's a nested pair 09:17
m: dd 1 => 2 => 3 09:18
camelia 1 => 2 => 3
Nemokosch what do you mean?
`=>` is apparently right associative
lizmat m: dd Pair.new(1,Pair.new(2,3))
camelia 1 => 2 => 3
habere-et-disper Thanks! How do we flatten it? 09:19
09:21 discord-raku-bot left
habere-et-disper I was expecting: `flat 1=>2=>3` to be `1=>2, 2=>3`... 09:21
09:21 discord-raku-bot joined
lizmat that's not flattening 09:21
you can't think of nested Pairs as a list 09:22
Nemokosch I wonder what "flattening" would even mean in this context
what result do you want to get?
habere-et-disper Okay -- thinking adjusting. :) 09:23
09:27 discord-raku-bot left, discord-raku-bot joined 09:28 habere-et-disper left, habere-et-disper joined 10:04 Kaipii joined 10:06 Kaipei left 10:14 razetime left 10:15 razetime joined 10:25 habere-et-disper left 10:57 habere-et-disper joined
lakmatiol if you want to use it as a linked list, you will need to write the flattening by hand 10:57
if you want to use it as a linked list, you will need to write the flattening by hand most likely
Superstart033 Hey guys, where do you discuss the the Exercism exercises?
habere-et-disper I am eager to share/discuss and help with the Exercism exercises. :) 10:59
Or ask for a mentoring request on Exercism.
That's what it's for! :) 11:00
lizmat m: dd 1, (2, (3, 4)) 11:01
camelia 1
(2, (3, 4))
lizmat m: dd 1, (2, (3, 4)).flat
camelia 1
(2, 3, 4).Seq
lizmat m: dd 1, (2, (3, 4)).flatmap
camelia Cannot resolve caller flatmap(List:D: ); none of these signatures matches:
($: &block, :$label, *%_)
in block <unit> at <tmp> line 1
lizmat m: dd 1, (2, (3, 4)).map:*.Slip 11:02
camelia ===SORRY!=== Error while compiling <tmp>
Confused
at <tmp>:1
------> dd 1, (2, (3, 4)).map:⏏*.Slip
expecting any of:
colon pair
lizmat dd (1, (2, (3, 4))).flatmap: *.Slip 11:03
m: dd (1, (2, (3, 4))).flatmap: *.Slip
camelia (1, 2, 3, 4).Seq
habere-et-disper Another way... 11:05
m: (1,(2,(3,4))).map( *.List ).flat
camelia ( no output )
Nemokosch I like the idea of Exercism but the tasks didn't seem well designed for me 11:06
I prefer the weekly challenges
habere-et-disper Or not quite yet... 11:08
m: (1,(2,(3,4)))[**]
camelia HyperWhatever in array index not yet implemented. Sorry.
in block <unit> at <tmp> line 1
12:57 habere-et-disper left 13:39 camelia left 14:05 Heptite joined 14:14 discord-raku-bot left 14:15 discord-raku-bot joined 14:17 camelia joined 16:50 Heptite left, Heptite joined 17:18 Kaipii left 17:42 razetime left 17:59 Kaipii joined 18:37 habere-et-disper joined 19:08 habere-et-disper left 20:00 Kaipei joined 20:03 Kaipii left 22:21 habere-et-disper joined 23:07 habere-et-disper left
Superstart033 Why does global variables can't have type constrains? 23:24
and, is there a "correct" way to write Raku scripts?
Like, in which order things go and so on
Nemokosch could you show an example? 23:30
23:41 kjp left
two things 23:41
1. I don't know why that is; in fact I don't know a lot about type constraints 23:42
I basically never use them outside function signatures, and even there only when they seem to be useful for some reason
2. an our-scoped variable is not the same as a global variable. I'm not sure if there are local our-scoped variables but there surely are global my-scoped variables 23:43
and without additional notes, I would imagine a my-scoped variable as a "global variable"
23:44 kjp joined
somebody asked it before 23:49
but the answer is, well, "less than awesome" as they speak 😄
it would take a core dev to tell
Kaiepi i find it kinda odd because a typecheck on `my` happens at the container level, but `our` installs a lexical symbol like `my` w/ an extra binding to `OUR` so you can kinda just 23:53
m:`BEGIN OUR::<$Typed> := my Str $Typed; say $Typed = "ok"; say $Typed = 1` 23:55
m:```
BEGIN OUR::<$Typed> := my Str $Typed; say $Typed = "ok"; say $Typed = 1
```
should be an `ok` line before the error 23:56
maybe it's the binding case that poses a problem? 23:59