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
are initial values in class fields mandatory ? (ocaml)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1998-06-23 (00:49)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: per-line comments
> > - there is no 'per line' comment (like Ada's "--" or C++'s "//" ) ? 
> I too think this is a must.  It may not quite accord with the personal 
> tastes of the CaML implementors,
Caml's comment syntax is more a question of historical tradition than
personal tastes.  After all, the comment syntax is perhaps the only
bit of syntax that hasn't changed between LCF ML, Caml, and Standard ML...

> but many good programmers use this
> extensively in their in-line documentation.

I don't quite get the point about in-line documentation.  I write
perfectly fine on-line documentation between (* and *).  Why would it
be any better with // or -- ?

> I figure they should be 
> able to transfer their "existing practice" when they make the switch to 
> CaML, just to make the switch as painless as possible.

Depends from which background you come.  E.g. for a well-trained C
programmer, delimited comments make more sense.

At any rate, the main problem with per-line comments (as with most
syntax extension) is that they need a reserved symbol.  Both // and --
are valid OCaml infix identifiers; // is even used in the Num standard
library module.

- Xavier Leroy