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.
02:48 DarthGandalf left
pelevesque Anyone know if I can put unit class Orfeo::API; instead of unit module Orfeo::API if my module is only one class? 04:52
Wondering if that would also get precompiled?
05:45 ranie joined 05:46 ranie left
roguerakudev I don't think it has any bearing on precompilation, but you can definitely do unit class in place off unit module ...; class ... is export { ... } 05:54
unit class behaves as if anything after it is within a class block 05:55
06:40 Chanakan left 07:54 DarthGandalf joined 08:16 dakkar joined
librasteve Looking at some Cro examples on GH i have decided to just use class {} (ie no unit declaration or version in each class file) and then rely on META6.json for version / author for the whole package (maybe i will get corrected here if that’s bad practice) 13:37
15:48 soverysour joined 16:34 jgaz joined 16:38 dakkar left 17:29 soverysour left 17:52 jgaz left 18:37 soverysour_ joined 18:51 PolarBearXL joined 18:55 jgaz joined
jgaz I tried some binary manipulation in Raku recently. There are some nice features, like `msb` but it seems odd to me that the right and left shift operators haven't been implemented. Is there some historical reason for this? I'm mainly just curious. 19:30
lizmat m: say 1 +< 4 19:48
camelia 16
lizmat you mean like that ?
m: say 64 +> 4
camelia 4
lizmat jgaz ^^ 19:49
jgaz lizmat. Weird. It's marked as unimplimented in the docs. I must have fat-fingered it, your example works on my end. 19:51
lizmat could you give the URL where it is marked as unimplemented ?
jgaz yeah, standby
docs.raku.org/language/operators 19:52
"Please note that this has not yet been implemented."
Okay, I think I conflated `~<` and `~>` with `<+` and `+>` which are implemented. 19:56
err... `+<` 19:57
lizmat docs.raku.org/language/operators#infix_+%3C
indeed
jgaz: *phew* 19:58
19:58 PolarBearXL left
jgaz Sorry about that. Well, now that I've made my sleep deprivation evident I have another question... wouldn't a unary version of left and right shift operators be generally useful? This would imply a single shift in either direction, akin to incrementing with `$x++`. 20:00
lizmat m: sub prefix:«+<»($a) { $a +< 1 }; say +<1 20:04
camelia 2
lizmat m: sub prefix:«+>»($a) { $a +> 1 }; say +<164 20:05
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in quote words; couldn't find final '>' (corresponding starter was at line 1)
at <tmp>:1
------> b prefix:«+>»($a) { $a +> 1 }; say +<164⏏<EOL>
expecting …
lizmat m: sub prefix:«+>»($a) { $a +> 1 }; say +<64
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in quote words; couldn't find final '>' (corresponding starter was at line 1)
at <tmp>:1
------> ub prefix:«+>»($a) { $a +> 1 }; say +<64⏏<EOL>
expecting …
lizmat m: sub prefix:«+>»($a) { $a +> 1 }; say +>64
camelia 32
lizmat fwiw, I don't this improves on readability 20:06
jgaz Fair enough. 20:07
Thanks for the help. 20:09
lizmat yw 20:12
jgaz So, semi-dumb question: when playing around with defining new operators only the Unicode angled quotes «...» seem to work. The ASCII stand-in is <<...>>, right? 20:45
21:00 soverysour_ left
lizmat jgaz: yes 23:04
afk again& 23:10