🦋 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.
hobbs is there a nice way to ask whether two ranges have any overlap? Basically I want ($x (&) $y).elems != 0 only without the heavy cost of coercing large ranges into sets for (&). 05:53
I can do like ($x.min ~~ $y or ($x.max-1) ~~ $y or $y.min ~~ $x or ($y.max-1) ~~ $y) (both ranges are excludes-max) and that's efficient, but the opposite of elegant. 05:55
hobbs ended up with: multi sub infix:<(&)>(Range:D $a, Range:D $b) { max($a.min, $b.min) ..^ min($a.max, $b.max) }. A version that handled excludes-min/excludes-max fully would be a little more verbose but I don't need it :) 08:53
nemokosch Is it deliberate that the output type is Seq? 09:19
mort can you not break out of a while loop in raku 09:37
wait apparently it's called last? 09:39
nemokosch it is 09:44
Geth advent/main: 75e6ce5c4f | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | raku-advent-2023/authors.md
Schedule Kay Rhodes' post for the 6th
11:49
lizmat clickbaits rakudoweekly.blog/2023/12/04/2023-...g-this-ad/ 15:33
tbrowder_ ugexe: sorry I didn't reply to yr last comment to me ref shell, i got buried in Christmas TODOs. with RakudoBin i will take your advice but add it as a another and better way to do it 18:13
mscha m: say so 1..0; 19:39
camelia True
mscha Shouldn't an empty range be False? 19:40
lizmat github.com/rakudo/rakudo/issues/5222 19:51
but the code I added there seems to have been remove again? 19:53
bisectable6: old=2023.04 say so 1..0;
bisectable6 lizmat, On both starting points (old=2023.04 new=8dca71e) the exit code is 0 and the output is identical as well
lizmat, Output on both points: «True␤»
lizmat bisectable6: old=2023.03 new-2023.04 say so 1..0; 19:54
bisectable6 lizmat, Cannot find revision “2023.03” (did you mean “2023.10”?)
lizmat bisectable6: old=2023.02 new-2023.04 say so 1..0;
bisectable6 lizmat, On both starting points (old=2023.02 new=8dca71e) the exit code is 1 and the output is identical as well
lizmat, gist.github.com/b681be0bd678f7f57f...c9a539548a
lizmat aaah...now I's remember 19:56
m: use v6.r; say so 1..0;
camelia ===SORRY!=== Error while compiling <tmp>
No compiler available for Raku v6.r
at <tmp>:1
------> use v6.r⏏; say so 1..0;
lizmat m: use v6.e; say so 1..0;
camelia ===SORRY!=== Error while compiling <tmp>
Raku v6.e requires PREVIEW modifier
at <tmp>:1
------> use v6.e⏏; say so 1..0;
lizmat m: use v6.*; say so 1..0;
camelia False
mscha Ah, thanks! 19:57
lizmat moved in f31a6d56dcb39ae
linkable6 (2023-04-17) github.com/rakudo/rakudo/commit/f31a6d56dc Move the fix to Range.Bool to 6.e
melezhik o/ 20:09
melezhik lizmat: does allow search in raku code ? I am interested in finding function calls from code examples , like foo(... params ... params ) ; where params chunk could be multi line 20:11
melezhik The end is of course is denoted by semi comma 20:12
mscha m: use v6.e.PREVIEW; say so 1..0; 20:16
camelia False
mscha m: use v6.e.PREVIEW; say "Huh?" if 1..0; 20:17
camelia Huh?
mscha m: use v6.e.PREVIEW; say "Huh?" if so 1..0;
camelia ( no output )
mscha Doesn't "if" force boolean context?
nemokosch ummm.... uh 20:19
in general, how did it ever become true in practice
trying to analyze the situation 20:29
m: use v6.e.PREVIEW; if 1..0 { say "HUH?" }; 20:32
evalable6 HUH?
Raku eval HUH?
nemokosch this escalated quickly
mscha Just guessing, but perhaps the implicit Boolean conversion of `if 1..0` uses the default 6.d version instead of the 6.e version?
nemokosch this is what I'm thinking, too 20:33
the implicit conversion has no traces in QAST so I suppose it's the runtime that somehow makes the call 20:34
m: use v6.e.PREVIEW; use nqp; nqp::if(False, say "HUH?") 20:38
evalable6
Raku eval
nemokosch I'm not exactly sure how this works but it does work...
m: use v6.e.PREVIEW; use nqp; nqp::if('', say "HUH?")
Raku eval
evalable6
nemokosch m: use v6.e.PREVIEW; use nqp; nqp::if(1..0, say "HUH?") 20:39
Raku eval HUH?
evalable6 HUH?
nemokosch and dang, it escapes
m: use v6.e.PREVIEW; use nqp; nqp::say(nqp::istrue(1..0)) 20:54
evalable6 1
Raku eval 1
nemokosch sad
this doesn't seem to be a trivial issue, I don't even know where to open it 21:00
mort if I have a num32 (aka a 32-bit float), can I view its bytes? 22:48
if I need to serialize it as a binary format 22:49
mort ah, Buf has write-num32 22:55