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 should definitely be allowed to convert an int/float variable to string but the way to do that needs some thinking.
At the moment it can only be a conversion at compile time. A variable conversion would work only at runtime (unless we introduce some form of const variables optimization).
Should the same notation be used for compile time and runtime conversion and just leave it to the compiler to figure it out?
(my vote at the moment is yes)
It should definitely be allowed to convert an int/float variable to string but the way to do that needs some thinking.
At the moment it can only be a conversion at compile time. A variable conversion would work only at runtime (unless we introduce some form of const variables optimization).
Should the same notation be used for compile time and runtime conversion and just leave it to the compiler to figure it out?
(my vote at the moment is yes)
a:i32 = 56 s:string = string(a)
versus
a:i32 = 56 s:string = to_string(a)
At the moment we allow explicit type conversion from almost all constant types to string. This is also tested here.
TODO:
Implement explicit conversion of elementary type variables to string.
The text was updated successfully, but these errors were encountered: