Re: Motion 46: finalise interval literals, amendments
On 2013-07-10 08:40:11 +0100, John Pryce wrote:
> (A)
> On 9 Jul 2013, at 07:59, Dmitry Nadezhin wrote:
> > Perhaps, there is an issue with leading zeroes in ratNumLit .
> > Let's take ratNumLit "010/011". It's value is 10/11 .
> > However, some languages treat leading zero as start of octal number,
> > so some users may expect that the value of the literal is 8/9 .
> >
> > Will it be safer if we forbid leading zeros in ratNumLit ?
>
> I don't think it's a good idea to restrict all implementations
> because of a feature of one language. Someone would come along with
> another unusual language feature and there would be no end to it.
Actually the C library is not just a language (C) feature, but also
a system library that can be used by other languages. For instance,
strtol() is not just specified by C99, but also by POSIX (though
POSIX is closely related to C).
> (B)
> What about restricting the size (length) of p and q? IMO an
> "industrial strength" implementation should not do so. But a small
> implementation such as for university student use may well wish to.
My remark about the size wasn't about industry vs student, but a
question of needed resources. Think of embedded applications...
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)