[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Ambiguity in number syntax
I was trying to implement a parser for the full number syntax in R3RS
and noticed that
#x1234e57
is ambiguous. Does it mean
(* #x1234 (expt 10 57))
or
19091031
Some solutions:
1. Flush scientific notation for hexadecimal numbers. Does anybody
really want to write real numbers (as opposed to integers or
rationals) in hexadecimal?
2. Require an explicit sign character in the exponent for such
numbers. Thus we would say
#x1234e+57
which is unambiguous.
I favor solution (2) since it leaves the syntax as general as
possible.