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.
habere-et-disper I can pass an operator with something like &infix:<+> 11:45
But how do I pass any infix operator?
Something like : 11:58
m: sub compute-infix( $a, &op, $b ) { $a &op $b }; say compute-infix( 3, &infix:<+>, 4 );
camelia all(3, 4)
lizmat m: sub compute-infix( $a, &op, $b ) { op($a,$b) }; say compute-infix( 3, &infix:<+>, 4 ); 12:10
camelia 7
habere-et-disper :] 12:11
lizmat++ 12:13
m: infix:<+>(3, 4)
camelia WARNINGS for <tmp>:
Useless use of "infix:<+>(3, 4)" in expression "infix:<+>(3, 4)" in sink context (line 1)
habere-et-disper m: say infix:<+>(3, 4)
camelia 7
jgaz How do I slurp a binary file starting at a specific offset? 16:30
lizmat "file".IO.open.seek($offset).slurp 17:41
but that wouldn't close the handle
jgaz but that only would make sense for files opened with :bin 17:45
for text based, you could wind up in the middle of a multi-byte code point
anyways: docs.raku.org/type/IO/Handle#method_seek 17:46
jgaz lizmat: thanks... 17:48