Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] petty complaints
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] petty complaints
On Mon, 2 Apr 2001, Xavier Leroy wrote:
> >     Another unrelated trifling question concerns the syntax of numerical 
> > literals. Would it be possible to allow a la Ada the insertion of _s in 
> > a numerical literal so instead of 1000000,10000000,and 100000000 we could 
> > write 1_000_000, 10_000_000, 100_000_000? Of course, as in Ada, you could 
> > allow wrongly positioned or superfluous _s (1_00_00_______0) but I think 
> > this trivial change can make reading numbers a bit nicer. 

Arrghhh, the Ada syntax allows arbitrary placement but no additional _s,
let this serve as an example to those who don't go right for the formal
syntax :-(. Here's the relevant part

based_numeral ::=
        extended_digit {[underline] extended_digit}

extended_digit ::= digit | A | B | C | D | E | F

I was reminded of this feature of Ada when I was hacking some (OCaml, not
Ada!) config files and I had to look carefully at a params to make sure I
got the number of zeroes right. 

-- Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr