Hi, I am new to nim and would be grateful if someone can help me with this -
(I have changed the back ticks around the operators to single quotes in order to be able to post here)
proc '+'* (A, B: Temp): Temp {.borrow}
proc '<'* (A, B: Temp): bool {.borrow.}
proc '<='* (A, B: Temp): bool {.borrow.}
proc '=='* (A, B: Temp): bool {.borrow}
works fine but both
proc '>'* (A, B: Temp): bool {.borrow.}
and
proc '>='* (A, B: Temp): bool {.borrow.}
fail !
Many thanks
> and >= are catch-all templates defined in system.nim, see
https://nim-lang.org/docs/system.html#%3E%3D.t%2Cuntyped%2Cuntyped
A > B just does B < A, there is no need to borrow them (and you can't).
work if > cannot be borrowed ? To be consistent that should also fail.
A > B just does B < A, there is no need to borrow them (and you can't).
That's wrong for float NaNs and any similar system, such as SQL's 3-valued logic. I didn't notice this before .. but I think this is something that should be more prominently documented; or am I wrong?