01:26 human-blip joined 01:44 Manifest0 left
ab5tract m: my $x=9; my $y=10; say ($x cmp $y ~~ Same|Less) ?? "ordered" !! "unordered"; 02:19
camelia ordered
ab5tract renormalist: ^^
== is for numeric operations, but ~~ (smartmatch) does what you mean here 02:20
m: my $x=10; my $y=10; say ($x cmp $y ~~ Same|Less) ?? "ordered" !! "unordered"; 02:21
camelia ordered
ab5tract m: my $x=11; my $y=10; say ($x cmp $y ~~ Same|Less) ?? "ordered" !! "unordered";
camelia unordered
ab5tract Regarding the last test case you linked to, I think ‘is’ cascades through a variety of equality check options, though I would have to check the source to be sure 02:25
Switching to ok and smartmatch works fine though
m: use Test; ok [Nil] ~~ [Nil], “no warnings allowed”
camelia ok 1 - no warnings allowed
ab5tract Hope it helps! 02:26
renormalist ab5tract: yes, it helps, thanks. For some reason I was staring only at the module, not the test is(). Switching to ok/~~. Thanks. 02:35
ab5tract My pleasure!
Nice idea with the type junctions btw 02:36
You can also put them into a subset. Maybe not really useful in this case but if you ever end up with more junction candidates it might come in handy 02:40
m: subset LessOrEqual where Same|Less; say (9 cmp 10 ~~ LessOrEqual) ?? "ordered" !! "unordered";
camelia ordered
renormalist m: my $x="9"; my $y="10"; say ($x cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:42
camelia ordered
renormalist m: my $x; my $y="10"; say ($x cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:43
camelia Use of uninitialized value $x of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
unordered
in block <unit> at <tmp> line 1
renormalist though this uninitialized warning - can ~~ also handle that without warning?
I think it does everything as long as there is a value and therefore a type. Having nothing does the right thing, not sure why it insists on the warning. 02:45
(Ok, the warning is important as it does NOT do the right thing.) 02:48
I guess I need to decide the semantics. Like here use a copy $xcopy and //= assign it to $y. 02:51
m: my $x; my $y="10"; my $xcopy = $x; $xcopy//=$y; say ($xcopy cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:52
camelia ordered
ab5tract m: my $x; my $y="10"; say (($x // “0”) cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:53
camelia unordered
renormalist (m: my $x; my $y=10; say (($x // “0”) cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:54
m: my $x; my $y=10; say (($x // “0”) cmp $y ~~ Same|More) ?? "ordered" !! "unordered";
camelia unordered
renormalist m: my $x; my $y=10; say (($x // 0) cmp $y ~~ Same|More) ?? "ordered" !! "unordered"; 02:55
camelia unordered
renormalist hm
ab5tract It makes sense, no? The condition is false, so we get “unordered” 02:57
m: my $x //= my $y="10"; say ($x cmp $y ~~ Same|More) ?? "ordered" !! "unordered";
camelia ordered
renormalist yeah, I'm probably confusing things while also looking at my actual sort module code 02:58
ab5tract Gotcha
renormalist Ok, anyway, I think I got it. Will get some sleep now. Thanks. 02:59
ab5tract I’m heading to sleep as well. Till next time!
renormalist good night
04:34 human-blip left 04:48 stanrifkin_ joined 04:51 stanrifkin left 09:35 lizmat_ joined 09:38 lizmat left 09:42 lizmat_ left, lizmat joined 11:29 Manifest0 joined 14:33 deadmarshal_ left 14:54 stanrifkin_ left 16:20 stanrifkin joined 17:02 deadmarshal_ joined 17:21 MasterDuke left 18:09 swaggboi left 18:23 swaggboi joined 18:30 swaggboi left 18:44 swaggboi joined 22:20 stanrifkin left