Pow Expressions - not worth the juice?

Dukc ajieskola at gmail.com
Mon Feb 2 18:30:38 UTC 2026


On Monday, 2 February 2026 at 17:43:45 UTC, Walter Bright wrote:
> https://dlang.org/spec/expression.html#pow_expressions
>
> They're a bit of an oddball feature in D, in that it's the only 
> feature that relies on Phobos for its implementation.
>
> Time for it to go?

No. It's established syntax, please do not break it. It's also 
handy, I sure prefer `a^^b` to `pow(a, b)` and slightly even over 
`a.pow(b)`.

However, there is a case for having power expressions to rewrite 
to a DRuntime symbol instead, even if that symbol then aliases to 
an `extern` function that is implemented in Phobos. Users should 
be able to override that DRuntime symbol, and it should be 
implemented so it only links to Phobos if the default DRuntime 
symbol is actually used - probably means the symbol should be a 
templated.


More information about the Digitalmars-d mailing list