read-ing scientific notation

Jon Fairbairn Jon.Fairbairn@cl.cam.ac.uk
Sun, 14 Oct 2001 12:35:14 +0100


> > The lexical syntax says that
> > 	10e3
> > means
> > 	10 e3
> > (i.e. two lexemes).   I don't like this choice, and it could be "fixe=
d"
> > in the Revised H98 report.
> =

> What is the likelihood of anyone *intentionally* writing an integer
> abutted directly with a varid, followed directly by another integer,
> and no intervening whitespace?  Nil, unless you are entering an
> obfuscated code contest, I reckon.  This looks like a good change
> to me.

Given that someone might well intend f 10 e3 and
accidentally write f 10e3, if there's a change at all I'd be
happier to make 10e3 erroneous. While that case is probably
going eventually to be caught by the type checker, it's
better to have mistakes pointed out as soon as possible.

I already intensely dislike the fact that f [1..10] mistyped
as f [1.10] can get through both syntax and type-checking,
so I'd vote against making the syntax more permissive unless
someone can prove that all the errors that get through as a
result are going to be caught some other way at compile
time.

  J=F3n


-- =

J=F3n Fairbairn                                 Jon.Fairbairn@cl.cam.ac.u=
k
31 Chalmers Road                                         jf@cl.cam.ac.uk
Cambridge CB1 3SZ            +44 1223 570179 (after 14:00 only, please!)