On Mon, Nov 25, 2002 at 10:06:13AM -0800, Michael Lazzaro wrote:
: With clarifications, and additional syntactic edge cases.
:
: The last remaining known "numeric literals" issue is whether we want to
: allow '.' in explicit radix, e.g. 10#1.234, or whether we want to
: disallow it as being Way Too Creepy. This version assumes that '.' is
: allowed, but exponential notation is _not_, due to ambiguities with 'E'.
:
:
: --- Numeric Literals ---
:
: decimal notation:
: 0123 # int 123 (not octal!)
Probably illegal in early Perl 6. Can perhaps allow it later.
: -123 # int -123 (but - is operator, not part of num)
Works because of constant folding.
: 0.1.1 # WRONG, can have only one decimal point
Is a v-string.
: .1 # WRONG; looks like method call on $_
: -.1 # WRONG, looks like method call on $_
Both legal, as in Perl 5. There are no numeric method calls, and
if there are you can always do them by indirection:
$meth = "1";
$foo.$meth()
: - explicit radix form may have radix point, '.',
: but cannot use exponential notation ('e')
Note that this is not a great hardship, since constant folding should
fix up things like
20#1.1 * 1e5
20#1.1 * 20**13
Larry