Raku / problem-solving

🦋 Problem Solving, a repo for handling problems that require review, deliberation and possibly debate
Artistic License 2.0
70 stars 16 forks source link

Root(s) - missing prefix operators #428

Open Tux opened 6 months ago

Tux commented 6 months ago

say √25; # expect 5 say √π; # expect 1.77245...

say ∛27; # expect 3 say ∜16; # expect 2

sub prefix:<√>(Numeric $n) { $n.sqrt }

Others are beyond my raku knowledge

Only problem I can spot is other scripts/programs/modules/scopes already defined it

lizmat commented 6 months ago

Only problem I can spot is other scripts/programs/modules/scopes already defined it

That is not a problem in Raku: inner lexical defines always supersede outer defines