Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
instance
   let foo x = 
     warning "foo should be implemented" 0

which should be compiled exactly like
   let foo x = 
    0
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 pa_trace.ml on
http://www2.poesia-filter.org:8000/cgi-bin/cvsweb.cgi/PoesiaSoft/PoesiaMonIcap/pa_trace.ml?sortby=date

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

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.

-- 

Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
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 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