Re: Underscores in numbers for legibility
Lassi Kortela 12 Apr 2019 22:37 UTC
> I have no problem with allowing underscores, as long as they can't be
> initial in a number. I think internal-only, single-only is the Right
> Thing, but *not* to force three digits, so that in India people can
> write numbers like 3_14_15_926 (read "three crore fourteen lakh fifteen
> thousand nine hundred and twenty-six" in Indian English). I think it
> should work with or without base and exactness prefixes, and in any
> digit string including fractional-parts and complex or higher-order numbers.
Thank you for once again bringing the international perspective.
So basically any place in a number that you can now have a string of two
or more digits, you could have those same digits plus any number of
underscores in between. As long as there aren't two or more consecutive
underscores.
> Accepting quantities (number + unit) is okay too, but we'd need some
> agreed-on internal representation of quantities with a constructor and
> accessors.
Units of measure are now one of the selling points of F# though I
presume Kawa's feature preceded it. Agree that they are complex enough
to deserve their own SRFI (though it's very good that we consider the
syntax implications early so we don't paint ourselves into a corner).