Front page | perl.perl6.language |
Postings from October 2001
From: RaFaL Pocztarski
October 11, 2001 17:58
Message ID: 3BC6406D.2605B6F2@rfl.pl
Jonathan Scott Duff wrote:
> It's bothered me that I can write 100_000 in my perl code, but if I have
> a string "100_000" it'll evaluate to 100 when numerified. It would be
> really weird if "10indigo" became 10i, "1e3foobar" became 1000, and
> "10_000" became 10 in Perl 6 IMHO.
That should be the easiest. Just ignoring underscores in strings. Even
if not by default, I think it should be made possible.
I think that it also should be possible (however not by default) to
output numbers that way in string context, with the chosen delimeter. So
it would be possible to just say that I want my numbers in string
context to always look like 10_000_000 or 10,000,000 or 10'000'000 or
whatever. Now it's to hard with clever regexes, it's very common and
should be easier.
- RaFaL Pocztarski, firstname.lastname@example.org