2 ms·
nah. just type coercion. Why would you parse a float? Parsing is for strings. Converting a float to an int is done with stuff like `Math.floor`.
by Groxx 3y ago
nah. just type coercion.
Why would you parse a float? Parsing is for strings. Converting a float to an int is done with stuff like `Math.floor`.
- xigoi 3y ago> Why would you parse a float? You wouldn't, which is why it should produce an error.
- deleted 3y ago[deleted]
- Groxx 3y agoWhich would be changing the paradigm away from implicit coercion, yes. That would make it a different, entirely hypothetical, ill-defined language. A very clear strawman that isn't particularly worth fighting. It would quite possibly be a better language, but it's not a thing you "just do" to solve footguns - it has pretty big effects on the language and ecosystem.