[Rd] Feature Request: Allow Underscore Separated Numbers

GILLIBERT, Andre Andre@G||||bert @end|ng |rom chu-rouen@|r
Fri Jul 15 08:31:05 CEST 2022



On 2022-07-14 8:21 p.m., avi.e.gross using gmail.com wrote:
> Devin,
>
> I cannot say anyone wants to tweak R after the fact to accept numeric
> items with underscores as that might impact all kinds of places.
>

I am not sure that the feature request of Devin Marlin was correctly understood.
I guess that he thought about adding syntactic sugar to numeric literals in the language.
Functions such as as.numeric(), or read.csv() would not be changed.

The main difference would be to make valid code that currently is a "syntax error", such as:
> 3*100_000
Error: unexpected input in "3*100_"

Breaking code with that feature is possible but improbable.
Indeed, code expecting that str2lang("3*100_000") make a syntax error (catching the error with try) would break.
Most code generating other code then parsing it with str2lang() should be fine, because it would generate old-style code with normal numeric constants.

--
Sincerely
Andr� GILLIBERT

	[[alternative HTML version deleted]]



More information about the R-devel mailing list