Skip to content

Instantly share code, notes, and snippets.

View Whateverable's full-sized avatar
☺️
Having fun on #raku on Libera.chat

Whateverable bots Whateverable

☺️
Having fun on #raku on Libera.chat
View GitHub Profile
@Whateverable
Whateverable / query
Created October 10, 2026 11:36
bisectable6
new=2026.08 my class A does Callable { has Str $.signature = "foo"; method CALL-ME($b) { "$b $!signature" } }; my constant &prefix:<c> = A.new; say c "hello";
@Whateverable
Whateverable / query
Created October 10, 2026 11:32
bisectable6
old=2025.01 my class A does Callable { has Str $.signature = "foo"; method CALL-ME($b) { "$b $!signature" } }; my constant &prefix:<c> = A.new; say c "hello";
@Whateverable
Whateverable / query
Created October 8, 2026 00:53
bisectable6
sub word(Str $g, Str $m, Str $f, Str $u --> Str) { $g eq "M" ?? $m !! $g eq "F" ?? $f !! $u }; my @g = <M F U>; my %want = M => "m", F => "f", U => "u"; my $wrong = 0; for ^20000 -> $i { my $g = @g[$i % 3]; $wrong++ if word($g, "m", "f", "u") ne %want{$g}; }; say $wrong == 0
@Whateverable
Whateverable / query
Created October 8, 2026 00:53
bisectable6
sub word(Str $g, Str $m, Str $f, Str $u --> Str) { $g eq "M" ?? $m !! $g eq "F" ?? $f !! $u }; my @g = <M F U>; my %want = M => "m", F => "f", U => "u"; my $wrong = 0; for ^20000 -> $i { my $g = @g[$i % 3]; $wrong++ if word($g, "m", "f", "u") ne %want{$g}; }; say $wrong == 0
@Whateverable
Whateverable / query
Created October 8, 2026 00:52
bisectable6
sub word(Str $g, Str $m, Str $f, Str $u --> Str) { $g eq "M" ?? $m !! $g eq "F" ?? $f !! $u }; my @g = <M F U>; my %want = M => "m", F => "f", U => "u"; my $wrong = 0; for ^20000 -> $i { my $g = @g[$i % 3]; $wrong++ if word($g, "m", "f", "u") ne %want{$g}; }; say $wrong == 0
@Whateverable
Whateverable / query
Created October 8, 2026 00:49
bisectable6
use Test; sub word(Str $g, Str $m, Str $f, Str $u --> Str) { $g eq 'M' ?? $m !! $g eq 'F' ?? $f !! $u }; my @g = <M F U>; my %want = M => 'm', F => 'f', U => 'u'; my $wrong = 0; for ^20000 -> $i { my $g = @g[$i % 3]; $wrong++ if word($g, 'm', 'f', 'u') ne %want{$g}; }; is $wrong, 0, 'an inlined ternary chain returns the right
@Whateverable
Whateverable / query
Created October 7, 2026 16:28
bisectable6
sink do (100 + 1) =:= (102 - 1)
@Whateverable
Whateverable / query
Created October 7, 2026 16:27
bisectable6
sink do (100 + 1) =:= (102 - 1)
@Whateverable
Whateverable / query
Created October 7, 2026 16:27
bisectable6
sink do (100 + 1) =:= (102 - 1)
@Whateverable
Whateverable / query
Created October 7, 2026 16:27
bisectable6
so $ = do (100 + 1) =:= (102 - 1)