On 11/10/22 18:48, Jean Abou Samra wrote:
Le 11/11/2022 à 00:40, Jean Abou Samra a écrit :
But I don't know what syntax to pick for that, or if it's essential
to have one or if "+" alone is already useful enough on its own.
1`16 is the best I could find, but it's not wonderfully mnemonic.
I think the reason why I can feel like it's a difference is the
set difference operator \ which is a bar in the same direction
as ` if you squint at it, but I doubt others will have that feeling ...
Well, another one is "1!16".
I'm having a hard time to explain why, but I feel it's much
better than "1`16" already, although not as elegant as
"1-16".
Bikeshedding here…. What about ` 1+-16 `? Defines the `+` operator as
additive scaling, the same as `*` is multiplicative scaling, and allows
negative numbers.
Hmmm… probably won’t work, unless `+-` is its own token (so `1 +- 16`
not `1 + -16`), since `-` has an established meaning and it’s been too
long since I played with lex/yacc to reason this out for real. And a
`+-` token is not better than the other options given.
--Joel