You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently actually impossible to define numeric constants other than int64 and float64. First-time usage in another size goes through a conversion function to load the global constant data in a smaller size.
Perhaps steal Rust's 0i8 style postfix annotation to declare them, or have the compiler detect 0.toInt8() as a unit and replace with the smaller constant type.
The text was updated successfully, but these errors were encountered:
Thinking about it with the new syntax, if I make built-in functions to work with the Int and Float types directly, I should be able to have it automatically match the type of the other integer or floating point value (or Fail if it is out-of-bounds).
How to handle situations like const val = 1 + 2; is the problem. Maybe it just stays the Int type and is figured out based on where it is used, but that would require some sort of "fall back to type operators" logic in the operator parsing logic, which I am not sure if it is a good idea. Would it be too magical? What if the "meaning" of the type operator it falls to doesn't match the function operator?
It is currently actually impossible to define numeric constants other than
int64
andfloat64
. First-time usage in another size goes through a conversion function to load the global constant data in a smaller size.Perhaps steal Rust's
0i8
style postfix annotation to declare them, or have the compiler detect0.toInt8()
as a unit and replace with the smaller constant type.The text was updated successfully, but these errors were encountered: