Feedback on FpySequencer numeric conversion/promotion #4037
zimri-leisher
started this conversation in
General
Replies: 1 comment
-
versus only allowing: I think this has to be allowed... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I'm writing the rules for numeric interpretation/conversion/promotion right now for Fpy, and I'd like the community's input on this.
Some notes:
My questions:
E.g.:
Alternatively:
I'm leaning towards yes, there should be some implicit conversion. This is supposed to be a Pythonic language, I don't want conversion contortions.
What should the hierarchy of conversions be? In CPP/C, F64 beats U64 beats I64. I.e. if you have any F64 in the input, all input will be converted to F64 and the float variant of the instruction is used. Otherwise, if you have any U64, all input is converted to U64, etc.
What should the type of
I64 / I64be? AnotherI64like CPP orF64like Python? Again, leaning towards Pythonic. Non-SWE users of Fpy will probably expect5 / 2 == 2.5and not5 / 2 == 2. We keep the//operator around for cases where the user explicitly wants integer division.Feel free to provide feedback on one or more of these. It's important to get these right!
Beta Was this translation helpful? Give feedback.
All reactions