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:28 deferen joined 00:36 habere-et-disper joined
MasterDuke kiranraku: you'd probably have to use a subset. e.g., `subset array10 of array where *.elems == 10; sub foo(--> array10[uint32]) {}`. i don't think that will work exactly as written, subsets and parameterization might not mix well, but that's how you'd do something like that in general 01:14
01:48 MasterDuke left 02:14 habere-et-disper left 02:26 teatwo joined 02:27 teatwo left 02:29 teatime joined 02:30 tea3po left 02:36 teatime left, teatime joined 07:54 ab5tract joined 08:12 dakkar joined 11:49 habere-et-disper joined 11:51 ab5tract left, ab5tract joined 12:11 habere-et-disper left 14:26 teatime left, teatime joined 14:38 dakkar left 14:39 dakkar joined
Tirifto Is there any way to let ‘when’ return control to the enclosing block and *not* ignore the remaining statements? :o 15:26
nemokosch not sure but I think you should ask yourself why you want that 15:28
Tirifto Obviously ‘if’ can work for that, but I’m wondering if I can use a ‘when’ block and only evaluate the code following it under specific conditions. As in: when A, { … (but if B, keep going) }
lizmat proceed? docs.raku.org/language/control#pro...nd_succeed 15:29
nemokosch what about proceed?
Tirifto Oh, yes! That’s exactly what I had in mind. I just read only the ‘when’ section (the one away from ‘given’), so I missed it. Thank you! x) 15:32
16:38 dakkar left
librasteve m: my uint32 @a[10]; say @a.shape; 18:49
Raku eval (10)
librasteve kiranraku: maybe this is what you need ^^^
m: my uint32 @a[10]; @a[11]=42; 18:51
Raku eval Exit code: 1 Index 11 for dimension 1 out of range (must be 0..9) in block <unit> at main.raku line 1
deferen [my uint8 $i = 255; $i = $i +< 1 #raku 254 20:55
my uint64 $i = 2**64 - 1; $i = $i +< 1 #raku Cannot unbox 65 bit wide bigint into native integer in block <unit> at <unknown file> line 1
Is that a bug?
(I would have hoped the second one to be truncated, without using +& (2**64 -1) ) 20:57
librasteve m: my uint64 $i = 2**64 - 1; say ($i +< 1).WHAT; 21:09
Raku eval (Int)
deferen Ho interesting. my uint8 $i = 255; $i = ($i +< 1).WHAT actually returns "Cannot unbox a type object (Int) to an unsigned int." 21:12
I guess there does not seem to be a way to remain in native types, they get promoted to Int in any case. 21:14
librasteve deferen: I think what is going on is that your native type uint64, when left shifted, overflows to an (Int) [which in raku is a BigInt by default] 21:15
deferen but there seems to be discrepancy in the uint8 and uint64 handling (perhaps usage of big num for the latter?)
librasteve m: my uint8 $i = 255; say ($i +< 1).WHAT; 21:16
Raku eval (Int)
deferen It makes sense, thank you 21:17
librasteve yeah, the docs specify that '+<' returns an Int 21:18
deferen it looks like '~<' might be closer to what I want, but it is not implemented yet (although I feel there should not be a conversion for native types to buf64 in that case) 21:22
librasteve I found this andrewshitov.com/2019/09/09/bit-co...in-perl-6/ 21:27
but not really addressing the issue 21:28
I agree that '~<' might be what you want ... sadly it is not implemented yet 21:29
22:51 ab5tract left 22:52 ab5tract joined