caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] suggestions: add a warning capability
@ 2003-01-10 11:03 Basile STARYNKEVITCH
  2003-01-10 12:45 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 2+ messages in thread
From: Basile STARYNKEVITCH @ 2003-01-10 11:03 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] suggestions: add a warning capability
  2003-01-10 11:03 [Caml-list] suggestions: add a warning capability Basile STARYNKEVITCH
@ 2003-01-10 12:45 ` Daniel de Rauglaudre
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel de Rauglaudre @ 2003-01-10 12:45 UTC (permalink / raw)
  To: caml-list

Hi,

On Fri, Jan 10, 2003 at 12:03:16PM +0100, Basile STARYNKEVITCH wrote:
> 
> 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)

Pcaml.warning. It is a "hook" (or a "plugin" if you prefer), i.e. a
reference. It is commented in pcaml.mli as "for system use", but I
can add an "official" version, not being a reference, calling that
function.

-- 
Daniel de RAUGLAUDRE
http://cristal.inria.fr/~ddr/
-------------------
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-10 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-10 11:03 [Caml-list] suggestions: add a warning capability Basile STARYNKEVITCH
2003-01-10 12:45 ` Daniel de Rauglaudre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).