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.
03:20 razetime joined 03:46 yjh joined
.ohnowendigo can I download the rakulang docs (guides + types + routines) as a pdf? I'm going on a 14 hour flight and want to be able to play around without internet 04:02
05:07 razetime left 05:15 razetime joined 05:50 razetime left 07:42 samebchase left 07:43 samebchase joined 07:45 samebchase left 07:46 samebchase joined 07:59 razetime joined
nemokosch Not really, I don't think so 08:04
However, you could clone the repo of the site and then host it for yourself 08:05
It's not difficult
github.com/Raku/doc-website 08:06
08:06 razetime left
Actually, I think there might be Docker images as well 08:06
Mehh, the Docker images don't seem to be public 08:16
08:19 tea3po joined 08:20 tea3po left, tea3po joined 08:21 tea3po left, tea3po joined 08:22 teatwo left, tea3po left, tea3po joined 08:55 razetime joined
yjh When trying to update a project (fez upload), I got an "Error processing: ???" email saying that there was an "Error reading META from your last upload".  Using Test::META to see what the problem is (raku -MTest -MTest::META -e "plan 1; meta-ok(); done-testing;") says I "don't have a META file" but raku -e "my \file = 'META6.json'.IO; say 'yes' if 10:46
file.defined and file.e" says I do.
nemokosch well, to state facts, do you have a META6.json file or not? 10:52
oh, found it 11:01
Test::META has a rather bizarre default that basically assumes that your script is in a subdirectory of the distribution, like the t/ folder 11:02
you can circumvent that by defining e.g my $*DIST-DIR=".".IO; before invoking the tester sub 11:03
(by the way, I don't think the file variable could ever by undefined, the way you initialized it) 11:05
s / by / be
12:32 razetime left 13:08 razetime joined 17:23 razetime left 17:27 ab5tract left 18:22 lucs left, lucs joined
jgaz So, if I have a hash with a numeric (base 16) key of, say, 0x09 I can look it up with %h<9> but not %h<0x09>. Is this intended behavior? 18:23
It also yells at me if I use my %h = { 0x09 => 'foo' } instead of the := binding operator. 18:26
nemokosch m: dd <0x09> 18:34
Raku eval IntStr.new(9, "0x09")
lakmatiol Is IntStr identity based on the string representation?
nemokosch yet another downvote for Allomorphs, it seems
identity as in === ? 18:35
lakmatiol Identity as in what hashes use
nemokosch so basically ===
they both use .WHICH
lakmatiol Yes, in that case that
nemokosch m: <0x09>.WHICH.say 18:36
Raku eval IntStr|Int|9|Str|0x09
nemokosch it is NOT identical to 9, neither is it identical to "0x09"
but a bare hash doesn't care about identity
a bare hash uses Str coercion
lakmatiol Ah yeah, that'd do it
nemokosch ... which is also wrong because 0x09 will coerce to "9" 18:37
jgaz okay, yeah, I follow
nemokosch and <0x09> will coerce to, well, "0x09"
jgaz So, I can define it as 0x09 but I better be passing in Int 9?
lakmatiol You should be able to do %h{0x09} if I have the semantics right 18:38
nemokosch you can write %hash{0x09}
lakmatiol Nice
jgaz okay, thanks. In this case it's all about readability.
nemokosch yeah you see, 0x09 is a number while <0x09> is sometimes a number, sometimes a string 18:45
honestly I haven't met anyone lately who explicitly expressed a liking to this feature, allomorphs that is
jgaz I wonder if there is a way to alter the lookup behavior so that 0x09 gets coerced to an Int. 18:51
I'm just thinking out loud.
nemokosch I wouldn't be optimistic with the "postcircumfix <>" syntax because that's just sugar really 18:53
jgaz yeah, ahh well... thanks folks. 19:25
librasteve allomorphs are great - they neatly embody the Stringy / Numeric flexibility from perl within the raku object model 20:28
wordpress.com/post/rakujourney.wor...ss.com/856
jgaz They just bite you sometimes :) 20:31
nemokosch there are two problems in one place 20:38
1. the diamond inheritance, i.e you can have something that "is a string" but sometimes acts like, say, a number 20:39
2. overall, deriving from Int and Str doesn't seem to be such a great idea. These types are value types that have their own literals. We have a lot of assumptions about what "a string" or "an integer" or "a boolean" etc. is, and the mental cost of breaking these assumptions seems so costly that it's hard to justify 20:42
for example, if you have "an integer", you want to assume that doing a numeric comparison is an identity check; after all, numerics are value types, and there is no reason to convert "an integer" to become a number 20:43
20:49 sjn left, sjn joined 20:53 teatwo joined 20:56 tea3po left, teatwo left 20:57 teatwo joined 21:19 jgaz left 22:08 lizmat_ joined 22:12 lizmat left 22:13 hythm joined
hythm re: "... If there is a way to alter the lookup behavior..", may overlode the AT-KEY method. Not tested but something like this: `role R { multi method AT-KEY (Int(IntStr) $key) {samewith $key}}; my %h does R` 22:21
22:30 hythm left