Pow Expressions - not worth the juice?

jmh530 john.michael.hall at gmail.com
Tue Feb 3 18:38:23 UTC 2026


On Tuesday, 3 February 2026 at 17:46:40 UTC, Walter Bright wrote:
> On 2/3/2026 7:11 AM, jmh530 wrote:
>> where the basically the `"op"` can be anything so long as it 
>> is delimited in a form like "%op%"
>
> In D that would be like:
> ```d
> x.op(y)
> ```

According to D grammar [1]:

> Identifiers start with a letter, _, or universal alpha, and are 
> followed by any number of
> letters, _, digits, or universal alphas. Universal alphas are 
> as defined in ISO/IEC
> 9899:1999(E) Appendix D of the C99 Standard.

which places limits on what "op" can be. That's why I elsewhere 
said that you would write something like `x.matmul(y)` in D 
whereas in R you would write `x %*% y` (Matlab's even more 
convenient with `x * y`, but they use `x .* y` for element-wise 
multiplication, which I like but deviates too much from C for D 
to adopt I think).

[1] https://dlang.org/spec/lex.html#Identifier


More information about the Digitalmars-d mailing list