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: | Philippe Wang <lists@p...> |
| Subject: | Re: [Caml-list] let int = ?([' ' '\t'] '-') digits+ |
Jon Harrop wrote: > On Friday 29 June 2007 16:56:45 Robert C Fischer wrote: > >> How would I write f - 1 to mean "one less than the value of f"? >> > > As: > > f - 1 > > The space before the digit means that it will not match this regexp. > > Or: > > f-1 > > The lack of a space before the "-" means that it will not match this regexp. I think it's quite too hard to explain, and it leads you to make mistakes too easily. By the way, I wonder how you could explain that to students learning the language... What I think is that : - whether they know nothing about programming : then they end up thinking it's quite too ugly... - whether they already know something about programming : they would think that the language is ugly and stick to those they already know... Anyways, I really wouldn't want that. One should not have to spend ten years to learn a programming language, just because of such tricks. -- Philippe Wang mail[at]philippewang.info