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:05 deoac joined
deoac Given `class C { has $.x; method y { ; } }; ` I can get a list of its methods with `say C.^methods;` .  Is there a similar way to get a `package`s "contents"? 00:11
package P {
    class C { has $.x; method y { ; } };
    enum E <foo bar baz>;
    sub S { say 'Hello'; };
}
Given `P`, how could I learn about `C`, `E`, and `S`? 00:12
00:16 Kaipei is now known as Kaiepi
Kaiepi like a `Stash`? `P::` or `P.WHO` will contain them in one, being a `Hash` of sorts 00:19
it's where `our`-scoped symbols in types that allow for them ggo 00:21
it's where `our`-scoped symbols in types that allow for them go
deoac Thanks, I didn't know about Stashes.  From the documentation: 01:24
    "Lexicals and methods are not included in a Stash, since they do not live in the package table. Lexicals live in a separate lexical pad, which is only visible from inside the scope."
how can I access that Lexical pad?
Also, how can I find out that `C` is a class, `E` is an enum?  `.^name` only returns `Stash` 01:28
01:29 frost joined 02:37 frost left 03:23 razetime joined 03:48 deoac left 03:58 Kaiepi left 04:51 Heptite left 06:55 Kaiepi joined
jaguart Anyone have recommends for AES encryption in Raku? Wrapper around openss libraries etc? Looking for some reasonable private-on-disk storage. 07:46
razetime OpenSSL bindings are at raku.land/github:sergot/OpenSSL 07:52
OpenSSL:CryptTools seems to have what you want, jaguart 07:53
08:22 razetime left 08:28 Kaiepi left 08:43 razetime joined 09:19 dakkar joined 10:30 Kaiepi joined 10:33 frost joined 10:34 razetime left 11:00 razetime joined 11:06 frost left 11:09 frost joined 12:44 frost left 13:23 razetime left 13:37 razetime joined
Kaiepi i was hoping there would be libsodium bindings for this 😦 14:00
openssl would be my next pick
deoac, i'm not sure there's a pretty way to go about getting the lexical symbols within a package. you could refer to `OUTER::LEXICAL` from an `our`-scoped block within one i guess 14:06
`C` and `E` differ as types not by their type, but by their `.HOW`
so you can see what's what with `.HOW.^name` 14:07
damn they're not here
14:21 frost joined 15:03 deoac joined
deoac Thank you, Kaiepi.  You've given me a lot to think about as I learn the Metamodel. 15:04
15:04 razetime left 15:13 razetime joined 15:23 frost left 17:36 dakkar left 17:48 Heptite joined 18:18 razetime left 19:51 jgaz joined
jgaz Is there a read-only version of the := operator? 19:57
Kaiepi there is mention of a `::=` operator in the design docs but there are complications with implementing it afaik? 20:05
Nemokosch exactly 20:06
jgaz Interesting... I wonder what the difficulty is. Is the nature of the complication documented somewhere? It might make for interesting reading. 20:08
I'm legitimately curious. 20:09
Nemokosch docs.raku.org/routine/::= perhaps complications is a strong word, the docs only say that it's "not yet implemented in Rakudo" 20:12
jgaz Nemokosch, thanks 20:14
That feature would strengthen Raku's already good FP chops.
Kaiepi i'm having trouble finding logs to do with `::=`, so i'm not sure where i get that idea from. i did find the design for it though design.raku.org/S03.html#line_2407
jgaz I keep pointing Haskell programmers I know who are looking to scratch their FP itch with a scripting language towards Raku with good results. 20:15
Kaiepi: would a GitHub issue inquiring about it be out of line? 20:34
Kaiepi a feature request wouldn't hurt i don't think 20:56
21:05 nicole left 21:07 nicole joined
Nemokosch to be honest, I'm not sure how the "read-only binding operator" would work 21:54
like, what it would do in the first place
22:00 jgaz left
lizmat my interpretation: my $a = 42; my $b ::= $a; $b = 666 # error 22:28
my $b ::= $a would be equivalent to: my $b := $a<> 22:29
23:05 habere-et-disper joined
habere-et-disper Hi all! Why can I initialize separately: 23:07
m: my UInt $foo = 3; my UInt @bar = [14]; say $foo, @bar;
camelia 3[14]
habere-et-disper But not together:
m: my UInt ( $foo,  @bar ) = ( 3, [14] ); say $foo, @bar;
camelia Type check failed in assignment to @bar; expected UInt but got Array ([14])
in block <unit> at <tmp> line 1