Browse thread
let int = ?([' ' '\t'] '-') digits+
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] let int = ?([' ' '\t'] '-') digits+ |
On Fri, 2007-06-29 at 16:39 +0100, Jon Harrop wrote: > If OCaml's lexer handled numbers of this format, would it be possible to > write: > > f -1 -2 > > to mean: > > f (-1) (-2) > > rather than: > > f - 1 - 2 > > Is this a good idea? No, I don't think so, because -1 and - 1 would then be distinct, and there's be confusion with: x-1 which would actually mean x (-1) rather than x - 1 That would break reams of code .. ;( -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net