caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: caml-list@inria.fr
Subject: [Caml-list] suggestions: add a warning capability
Date: Fri, 10 Jan 2003 12:03:16 +0100	[thread overview]
Message-ID: <15902.43124.883844.293250@hector.lesours> (raw)

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


             reply	other threads:[~2003-01-10 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10 11:03 Basile STARYNKEVITCH [this message]
2003-01-10 12:45 ` Daniel de Rauglaudre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15902.43124.883844.293250@hector.lesours \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).