[r6rs-discuss] Hashes in the number syntax
William D Clinger
will at ccs.neu.edu
Sun Nov 19 20:32:01 EST 2006
I am posting this as an individual member of the Scheme
community. I am not speaking for the R6RS editors.
Jens Axel Soegaard wrote:
> If 1## were specified to be read as #i150, then I could
> see a use for the syntax. As is things are now, it can be
> read as any number between 100.0 and 200.0 .
> Most implementations treat is as 100.0, which seems
> to be against the spirit of the notation. So in practice,
> I'd write #i150 instead of 1## .
When engineers or scientists write 5e2, they mean the
value is roughly 500, plus or minus. The purpose of the
5## notation, as I understand it, was to allow a Scheme
programmer to say the same thing as 5e2 without having
to use the exponent notation.
> I looked for an explanation of the syntax # syntax
> in R5RS and R6RS, but couldn't find any. If the notation
> is worth keeping, it is worth explaining.
Agreed. If this syntax is kept, I think the R6RS ought
to say that the # digits represent zeros that aren't
> I tried searching for this pattern in the PLT Source base
> including all PLaneT packages:
The notation is mainly for use by engineers and scientists
who want to express the number of significant digits more
precisely, without resorting to scientific notation. The
PLT source base contains a lot of code, but the MIT Scheme
source base probably contains more code written by engineers
More information about the r6rs-discuss