Mark J. Reed wrote:
I read the statement "use A or B for base 12, not T or E" as meaning
"for the values ten and eleven in base 12, use :12<A> and :12<B>, not
:12<T> and :12<E>."
Does it say anywhere that you can use non-decimal notation for the
radix specifier itself? 'Cause that strikes me as overcomplicating
things for little gain. But even if you could, :A would have to be
base 10 and :B base 11...
I'm not proposing that Perl 6 support non-decimal notation for the radix
specifier, at least not in combination with decimal notation always being
used to indicate bases 2-10; better then to just be decimal all the way.
However, *if* one wanted a system where a radix specifier could be
unambiguously written to look the same as the literal is describing, then I
have developed a clean system where that is possible. Essentially, the
radix specifier would be a 1-character number written in the same radix as
the literal, and whose value is one less than the base, and is equal to the
maximum value that a single character literal in that base could have. For
bases 2-10, it would look exactly like the current Perl 6 method but that
the indicator is smaller by one.
Pseudo-examples, in binary,octal,decimal,hex each of which equals twelve:
:1<1100>
:7<14>
:9<12>
:F<B>
Now I think this general format has a lot of merit, but I'm not going to
propose that Perl 6 changes away from its current system of just using
decimal literals that equal the base in question; the current system is
still just as good, if different, and does not need replacing, and any
replacement needs exact syntax that won't confuse with other language
constructs like Pair literals or routine calls.
-- Darren Duncan