Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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

and 

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 
liking. 

Feel free, argue for your choices. 

-- Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners