Re: Allow underscore as separator for number literals
Posted: Tue Feb 23, 2021 3:07 pm
° and ´ are no Ascii charactersLord wrote:Even if I don't like number seperators,
there are some characters left: ^°´`
for separetion.
No one said you have to use the separators.BarryG wrote:I don't think there's any point to this request anyway, because when you copy source codes from somewhere else (C++, StackOverflow, etc) then the separators aren't going to be there anyway. Are you going to manually change every number from the copied code?
Contrary to the request here, the tilde character is required for an escaped string.TI-994A wrote:A prefix should be implemented to indicate such formatting, similar to the tilde (~) for escaping strings. Best to keep literals and formatting separate.
The requested delimiters have nothing to do with formatting the literal, the compiler would simply ignore the delimiters. The delimiters are only for better readability of the code, in case of an output no delimiter would be present either.
In general, I would say that there is no need to reinvent the wheel. It is not a shame to look beyond the end of the own nose and then one will quickly discover that alternativ used separators _ or ' are quite common in other programming languages.