caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Yann Régis-Gianas" <yann@lrde.epita.fr>
To: "Yaron M. Minsky" <yminsky@CS.Cornell.EDU>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] autoconf and caml
Date: Fri, 6 Sep 2002 13:33:20 +0200	[thread overview]
Message-ID: <20020906113320.GA16693@barcelona.lrde.epita.fr> (raw)
In-Reply-To: <3D7889EA.8060406@cs.cornell.edu>

On Fri, Sep 06, 2002 at 06:56:42AM -0400, Yaron M. Minsky wrote:
> Yes, but you actually don't really want simple values here, because 
> sometimes you want to use those values to do conditional compilation, 
> and ocaml values won't help you with that.
> 

	I think conditional compilation cannot be done since modules
are not first class citizens. The only way I see is to introduce
preprocessor comands with camlp4.

	The question is : what kind of conditional compilation do you
want ?  If you want something like:

	let foo x =
#ifdef I_LOVE_FOO
	  "foo"
#else
	  "bar"
#endif        

	It can be replaced by:

	open Config

	let foo x = if i_love_foo then "foo" else "bar"

	You will not pay a runtime cost because "i_love_foo" is a
static value and unused code will be trimmed by ocaml compiler.

-- 
Yann Régis-Gianas.
-------------------
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:[~2002-09-06 11:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-04 15:20 Kenneth Oksanen
2002-09-05 11:57 ` Xavier Leroy
2002-09-05 12:23   ` Kenneth Oksanen
2002-09-05 12:53     ` Olivier Andrieu
2002-09-05 13:16     ` Lauri Alanko
2002-09-06 10:12       ` Kenneth Oksanen
2002-09-06 10:25         ` Jun P.FURUSE
2002-09-06 10:46         ` Yann Régis-Gianas
2002-09-06 10:56           ` Yaron M. Minsky
2002-09-06 11:07             ` Maxence Guesdon
2002-09-06 12:31               ` pa_ifdef [Was: Re: [Caml-list] autoconf and caml] Stefano Zacchiroli
2002-09-06 12:52                 ` Daniel de Rauglaudre
2002-09-08 10:07                   ` Stefano Zacchiroli
2002-09-09  8:59                     ` Daniel de Rauglaudre
2002-09-06 11:33             ` Yann Régis-Gianas [this message]
2002-09-06 11:22               ` [Caml-list] autoconf and caml Yaron M. Minsky
2002-09-06 11:28                 ` Jérôme Marant
2002-09-06 11:41                   ` Yaron M. Minsky
2002-09-06  9:42   ` Hendrik Tews

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=20020906113320.GA16693@barcelona.lrde.epita.fr \
    --to=yann@lrde.epita.fr \
    --cc=caml-list@inria.fr \
    --cc=yminsky@CS.Cornell.EDU \
    /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).