🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:00 reportable6 left 00:01 reportable6 joined 00:41 jpn joined 00:44 deoac left 00:45 jpn left 01:25 razetime joined 01:26 razetime left 01:30 markb17 left 02:28 jpn joined 02:33 jpn left 03:08 ProperNoun left 03:16 ProperNoun joined 04:16 evalable6 left, linkable6 left 04:17 jpn joined 04:19 evalable6 joined, linkable6 joined 04:22 jpn left 05:14 jpn joined 05:18 jpn left 05:34 siavash joined 06:00 reportable6 left 06:01 reportable6 joined 06:47 Xliff left 07:47 linkable6 left, evalable6 left 07:48 evalable6 joined 07:50 linkable6 joined 08:16 teatwo left 08:17 teatwo joined 08:29 habere-et-disper joined 08:32 sena_kun joined 08:40 habere-et-disper left 08:58 hythm joined
hythm :m say v0.2.1 cmp v0.2 08:58
tellable6 2023-08-12T14:55:15Z #raku <tbrowder__> hythm thanks! i’ll try that
hythm m: say v0.2.1 cmp v0.2 08:59
camelia More
hythm m: v0.2.1 ~~ v0.2 ## is this intentional?, no need for `+` like v0.2+ 09:00
camelia ( no output )
hythm m: say v0.2.1 ~~ v0.2
camelia True
09:31 siavash left 10:31 linkable6 left, evalable6 left 10:32 evalable6 joined, linkable6 joined 11:05 jpn joined 11:09 jpn left 11:33 hythm left 12:00 reportable6 left, reportable6 joined 12:02 hythm joined 12:10 sena_kun left 12:19 ab5tract joined
jdv www.youtube.com/watch?v=9J0vCQ36020 (again) 12:36
12:41 jpn joined
nemokosch see, immediate mumbling about Perl in the comment section 12:42
but who is this moustache showman? 12:44
12:48 jpn left
saw a reference to Dreamberd in the chat, that's not a good sign xd 12:48
13:12 linkable6 left 13:14 linkable6 joined 13:23 wayland left, wayland joined 13:44 xinming left 13:46 xinming joined 14:14 codesections left 14:21 Vyrus is now known as Vyrus|away 15:44 jpn joined 15:48 jpn left 17:02 sena_kun joined
tbrowder__ tis me again, asking about best practice for raku and zef on a mult-user system 17:06
can anyone see any reason for root to need zef? 17:11
or even raku? 17:13
i can see using them for scripts for managing the system (in place of bash scripts). 17:16
so, then how is the best way to set the paths for root? 17:29
17:48 jpn joined 17:54 jpn left 17:59 ab5tract left 18:00 reportable6 left 18:03 reportable6 joined
gfldex tbrowder__: gist.github.com/gfldex/463657030fc...078243fb80 18:21
18:36 Xliff joined
Xliff How can I type the key of the hash as a type object? 18:36
Especially if I want to type a $ sigiled hash value...
lizmat m: my %h{Str:U} = ::("Str") => 42; dd %h 18:38
camelia Hash[Any,Str:U] %h = (my Any %{Str:U} = (Str) => 42)
lizmat m: my %h{Any:U} = ::("Str") => 42, ::("Int") => 666; dd %h 18:39
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
Use of uninitialized value of type Str in string context.
Me…
lizmat m: my %h{Any:U} = ::("Str") => 42, ::("Int") => 666; dd %h.keys
camelia (Int, Str).Seq
Xliff And if I need it as $h?
^^ lizmat 18:41
lizmat m: my $h := Hash[Any,Any:U].new( ::("Str") => 42, ::("Int") => 666 ); dd $h.keys
camelia (Int, Str).Seq
Xliff Ah! Thanks! 18:42
m: Hash.HOW.^name.say
camelia Perl6::Metamodel::ClassHOW+{<anon>}
lizmat my Int %h{Str} is just short for my %h := Hash[Int,Str].new
Xliff So is Hash a Parametric Role masquerading as an object, then? 18:43
lizmat no, actually it has a ^parameterize method in its HOW
which does the correct mixins 18:44
Xliff Ah!
So you can have parametric classes in Raku if you know the right secret ingredients?
lizmat github.com/rakudo/rakudo/blob/main...#L436-L478
nemokosch is this parametrisation role-only? 19:06
lizmat see: github.com/rakudo/rakudo/blob/main...h.pm6#L486 19:09
Xliff Wait... Pairs are immutable? 19:17
m: my $a = Pair.new('a', 0); $a.value = 1; $a.gist.say 19:18
camelia Cannot modify an immutable Int (0)
in block <unit> at <tmp> line 1
Xliff What's a Mutable pair?
Is there a Mutable version of Pair? 19:19
teatwo that error message makes it sound like it's the Int not the Pair that is immutable; not that I understand it 19:20
Xliff m: DateTime.now.Date.succ.say 19:21
camelia 2023-08-21
teatwo I guess because "It is worth noting that when assigning a Scalar as value of a Pair the value holds the container of the value itself. This means that it is possible to change the value from outside of the Pair itself:" and you have a literal 0 19:22
?
nemokosch Pairs aren't strictly immutable 19:28
they are as immutable as a List, basically
the key is immutable, the value can be a container
tbrowder__ gfldex: thanks so much 19:31
nemokosch so teatwo is on the right track
19:36 linkable6 left, evalable6 left 19:39 evalable6 joined, linkable6 joined
lizmat teatwo: correct so Pairs are not value types, just likes Lists aren't, as nemokosch noted 19:52
tbrowder__ another raku inst question (for rakudo-pkg installations): what is the purpose of the var/zef/bin/zef executable? 20:00
20:18 teatime joined 20:20 teatwo left
librasteve I often like to refer to the typegraph - this one shows how Pair and Map and Hash relate via the Associative role, but that Pair does not do Iterable docs.raku.org/assets/typegraphs/Associative.svg 20:42
21:20 linkable6 left, evalable6 left 21:21 evalable6 joined 21:23 linkable6 joined 21:27 habere-et-disper joined 21:30 Xliff left 21:52 habere-et-disper left
tbrowder__ one more raku inst question: anything wrong with making a symlink from /opt/rakudo-pkg/bin/raku to /usr/local/bin/raku? 21:54
my questions are from discussions on debian users list about how to best handle raku and paths for a normal user as well as root 21:57
Voldenet I simply add /opt/rakudo/bin to my PATH 22:01
works on debian
has nice added bonus of also providing nqp and moar
22:27 wayland left 22:38 sena_kun left 22:49 nikka joined, nikka left 23:36 razetime joined