Is it possible to define custom metaoperators in Raku?

Viewed 142

The standard way to define a new operator in Raku is

multi sub infix:<operator> ($l, $r) { ... }

With different options instead of infix. I would like to define a custom meta operator, however. The closest I can come (matching the idea of @a X+ @b) is

multi sub prefix:<F> (&bar) { ... }

But while it compiles, the only way to get it to work with, e.g., the + operator is to use an full identifier:

(F&infix:<+>)($a, $b)

Or are metaoperators definable?

1 Answers

You cannot currently define custom meta operators in Raku.

You might be able to get one to work through a slang, but with Rakudo-specifc code, and slangs aren't really well document -- the best you can do is google tutorials and examples, docs.raku.org is silent on them :-(

Related