English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] CamlP4 Revised syntax comment
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-30 (17:49)
From: artboreb@n...
Subject: Re: [Caml-list] CamlP4 Revised syntax comment
Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> wrote:

>On Mon, Oct 28, 2002 at 09:38:04AM +0100, Kontra, Gergely wrote:
>> I really dislikes the do { } notation.
>> My suggestion is to use do end pairs, which is borrowed also from ruby.
>> And if we want more ruby-ish (ada-like?), the matching can be
>> match a with
>> | 0 ->
>> | n ->
>> end
>I like the way Ada ends its statements. However, as said in the
>chapter about the revised syntax (tutorial), we took the option not to
>end the statements with a keywork ("end", or "fi" or things like
>that), in order to show that all of that is functionnal.
>When you see:
>      if e1 then e2 else e3 end
>you don't have the impression that e2 or e3 are *results*: the "end"
>gives you the impression that everything is terminated. Often, newbies
>don't understand the functional way this statement must be read. If we
>change the syntax with this "end", it is going to be more difficult to
>explain then.
>This way, I regret a little bit the "do { }" of the "for" loop. A
>"do .. done" would have been more logical (same for "while").

I like and seems me a good compromise actual revised syntax,
also do { ... } is a good (and visible warning) that may be
side effects to care. No way to if ... else ... end as you
said it isn't FP (it is pure impertative style).
I prefer the revised syntax despite extra verbosity because
it overcomes some confusing situations of the official syntax.
(if with or without else, { and begin, } and end, the match
function ... among others).

Best regards. 

Arturo Borquez

The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
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