Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Threats on future of Camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-11 (16:36)
From: brogoff@s...
Subject: [Caml-list] Syntax
On Fri, 11 Oct 2002, Kontra, Gergely wrote:
> Another thing, that
> bothers me is the do { } syntax. It seems a bit silly mixture of some
> shell and C syntax, I think either do ... done or { ... } would be a
> good choice 

Actually, more like Haskell to me. 

Originally, the syntax was 

do e1; e2; e3; return e4


while e1 do e2; e3; e4 done 
for v = e1 to e2 do e3; e4 done

As noted in the tutorial, not using "done" would save a keyword. So that would 
argue for using {} or some other non-alphanum bracketing tokens, and saving "do" 
as well. 

A counterargument is that the keyword may make it more readable, as the 
imperative sections of the code stand out more, and that's probably what you 
want in an ML family language, which while, imperative, supports a functional 
programming style well. 

I think the "do {}" is fine, and better than both the OCaml syntax and the 
previous Revised one. I could be convinced that {} or the like is better, 
but only by a little if at all. 

> Ok, I know, you'll say: "Then why don't you write your own syntax?"

No, I perfectly understand that there are people who aren't keen on OCaml 
syntax but would still prefer to be in a community of programmers using the 
same syntax. And, since Revised has such a relatively small community, 
that you may feel that you may influence it's development to be more to your 

Feel free, argue for your choices. 

-- Brian

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: