caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David MENTRE <dmentre@linux-france.org>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] How to avoid compiling some code (like #ifdef in C)
Date: Fri, 12 Sep 2003 14:15:45 +0200	[thread overview]
Message-ID: <8765jyfbim.fsf@linux-france.org> (raw)
In-Reply-To: <20030911173056.A29749@pauillac.inria.fr> (Xavier Leroy's message of "Thu, 11 Sep 2003 17:30:56 +0200")

Hello Xavier,

Xavier Leroy <xavier.leroy@inria.fr> writes:

> With ocamlopt, that code is eliminated as part of constant
> propagation.

Thank you to confirm my guess.

>> Does anybody see a better approach to do such a thing?

> Whether this is a "better" approach is open to debate.  With a
> preprocessor, you can remove not just code for expressions, but also
> other kind of code, e.g. code for the toplevel binding "let a() = ...".
> So, you get more flexibility, but at the expense of less static
> checking.  In particular, code that is #ifdef-ed out is not
> type-checked, while it is type-checked in your solution above.

I'm personally find that static checking is very useful. So, for my own
issue, the approach I proposed is "better". It allows me to be sure that
all automatics tests will always at least compile. And it works on
O'Caml 3.04 available in my old debian 3.0.

But I'll keep in my mind the two other approaches. 


Thank you for your answer,
Yours,
david
-- 
 David Mentré <dmentre@linux-france.org>
   http://www.linux-france.org/~dmentre/david-mentre-public-key.asc
 GnuPG key fingerprint: A7CD 7357 3EC4 1163 745B  7FD3 FB3E AD7C 2A18 BE9E

-------------------
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


      parent reply	other threads:[~2003-09-12 12:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10 17:14 David MENTRE
2003-09-10 17:31 ` Markus Mottl
2003-09-11 15:30 ` Xavier Leroy
2003-09-11 16:28   ` Richard Jones
2003-09-12 12:15   ` David MENTRE [this message]

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=8765jyfbim.fsf@linux-france.org \
    --to=dmentre@linux-france.org \
    --cc=caml-list@inria.fr \
    --cc=xavier.leroy@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).