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] single-line comment request
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-08 (21:39)
From: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] single-line comment request
On Tue, Apr 08, 2003 at 03:22:59PM -0500, Brian Hurt wrote:
> On Tue, 8 Apr 2003, Basile STARYNKEVITCH wrote:
> > I also suggest the following di-graph for comments
> >   #! (which is compatible with Unix first line execve convention)
> Aha!  OK- here is a really good reason to add single line comments, with 
> #! as the comment delimiter- so we can put
> #!/usr/local/bin/ocaml
> as the first line in our programs, and have Ocaml as an interpreted 
> scripting language, as well as a interpreter/bytecode/native language.

ocaml (as opposed to ocamlc) recognizes this as comment, but only at the
first line of a file.

> All of the above are valid operator names.  Not sure about [*].  See page
> 91 of the language standard.

Neither [*] nor #! are accepted by ocamlc as operator names.

I personally would find single line comments useful for turning various
debugging (single line) calls on/off, e.g.:

  f ();
  (* dbg "f done"; *)
  let i = g () in
  dbg "g done, %d" i;
  h ()

But I don't care much, just need to write vim macro :-)

: Michal Moskal :: : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h

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