Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Discussion of interval literal syntax



On 2013-07-20 12:04:08 +0100, John Pryce wrote:
> On 2013 Jul 20, at 00:30, Vincent Lefevre wrote:
> > Requiring that all interval literals start with "[" and end with
> > the first "]" can help...
> 
> I rather like the conciseness of uncertain form *without* the
> brackets, 1.234?5 not [1.234?5], but the convenience for
> implementers should have high priority.
> 
> Straw poll please from those with experience in parsing. Does
> Vincent's suggestion make it easier to parse interval literals? E.g.
> to create an LR(1) grammar to do the parsing. Especially in the
> context of reading them as data from a stream.

Not just parsing by a computer. As a human, I find the form with
the brackets much better to see immediately that it is an interval,
instead of a number, in particular when there are many digits (e.g.
in multiple precision, with also a large number of ulp's).

IMHO, if conciseness is important, then I think that the brackets
should always be made optional for text2interval, since there's no
ambiguity.

-- 
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)