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 discord-raku-bot left 00:19 discord-raku-bot joined 00:41 Kaipei left 01:20 [Coke]__ joined, [Coke] left 01:36 habere-et-disper joined 02:03 frost75 joined 02:04 deoac joined 02:38 frost75 left 02:44 habere-et-disper left 03:16 deoac left 04:30 Heptite left 04:31 discord-raku-bot left 05:11 discord-raku-bot joined 05:15 discord-raku-bot left 05:34 discord-raku-bot joined 05:37 discord-raku-bot left 05:40 discord-raku-bot joined 07:48 Kaipei joined 08:15 dakkar joined 08:36 Manifest0 left 10:34 Kaipei left 10:56 Kaipei joined 12:32 Kaipei left 12:41 Kaiepi joined 13:59 MasterDuke joined 14:57 Heptite joined 15:01 jgaz joined 15:15 deoac joined
deoac Is it possible to send a type as an `sub` argument?  e.g. `sub foo (:$type=Rat) { ... }` 15:16
Rog deoac: `sub say-type(Mu $obj) { say $type.WHAT }` 15:32
Then `say-type Rat` for example 15:34
This uses the fact that Raku has “type objects” which are referred to just by the class name 15:35
MasterDuke m: sub say-type(::T) { say T }; say-type(Rat) 15:36
camelia (Rat)
Rog The type object still has all the methods, just no field values, and some methods may be uncallable because their signature specifies that the object must be defined 15:37
Oh nice, even better
Definite, not defined, rather
deoac Thank you. 15:39
15:39 deoac left
Nemokosch I still don't seem to get this :: 15:40
what does it say or do?
Rog I didn’t realize you could directly type capture like that without a parameter
:: is the package separator and if the left hand side is missing it’s special-cased 15:44
The docs refer to is as the “null pseudopackage”
to it as*
I’m not sure what a good way to think about it is for type capturing in signatures 15:50
Roughly you can think of it as meaning “in the current scope” but I’m not sure if there’s any deeper reason or intuitive explanation as to why it “captures” in signatures rather than looking up an existing name 15:54
Nemokosch yeah I don't get it, lol 15:58
16:03 Kaiepi left 16:08 Kaiepi joined 16:39 dakkar left 16:40 lucs left 16:41 sivoais left 16:42 sivoais joined 16:45 lucs joined 16:55 equinox joined 16:56 equinox left, equinox joined 17:15 Heptite left 17:39 Heptite joined 18:16 equinox left 18:20 MasterDuke left 19:19 equinox joined
masukomi > The null pseudo-package is the same search list as an ordinary name search. That is, the following are all identical in meaning: 19:58
```
$foo
::{'$foo'}
::<$foo>
```
We use it in ruby all the time because without it things aren't at top-level scope. Sometimes we need to use it to kind of kick the compiler and say "no really... start at the top level namespace"
Seems similar in Raku
<@297037173541175296>
> The null pseudo-package is the same search list as an ordinary name search. That is, the following are all identical in meaning: 20:00
```
$foo
::{'$foo'}
::<$foo>
```
We use it in ruby all the time because without it things aren't necessarily at top-level scope. Sometimes we need to use it to kind of kick the compiler and say "no really... start at the top level namespace"
Seems similar in Raku
<@297037173541175296>
20:01 Ebudae joined 20:04 Heptite left 20:06 Ebudae left 20:53 equinox left 21:24 [Coke]__ left 21:38 jgaz left 22:48 Guest95 joined 22:50 Guest95 left 22:51 Heptite joined