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] suggestions: add a warning capability
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-01-10 (11:03)
From: Basile STARYNKEVITCH <basile@s...>
Subject: [Caml-list] suggestions: add a warning capability
Dear All (and Caml team)

First a Happy New Year to all.

Second, a suggestion to the Caml team. Add a warning ability, like the
#warning of GCC.

The idea would be that an expression can be warning message value, for
   let foo x = 
     warning "foo should be implemented" 0

which should be compiled exactly like
   let foo x = 
except that the compiler outputs a warning message with the 
"foo should be implemented" message at compile time.

Perhaps I am showing my old (43) age, but I love to put compile-time
warnings in code which I have to correct or implement!

And yes, it is trivial to implement in Camlp4 - I did it in a couple
of minutes. People wanting it now could fetch the latest (>= 1.8)
revision of on

I feel sometimes sorry that the default Ocaml parser is not Camlp4 (I
guess that there are some internal conflictual issues somewhere on

This warning syntax is just syntactic sugar, like ignore and assert
are. Both are very useful.

A last tiny suggestion to Daniel de Rauglaudre - document a way to
output error or warning messages in the usual format - I mean just
provide a function output_error location message in Camlp4 library...
(It is probably there already but I didn't notice it)

Regards and thanks again to the Caml team.


email: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: