caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Brown <caml-list@davidb.org>
To: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Even at compile time 2*2=4!
Date: Tue, 19 Nov 2002 10:09:00 -0800	[thread overview]
Message-ID: <20021119180900.GA24889@opus.davidb.org> (raw)
In-Reply-To: <20021119121201.A18538@verdot.inria.fr>

On Tue, Nov 19, 2002 at 12:12:01PM +0100, Daniel de Rauglaudre wrote:

> In some cases, you could resolve your problem with Camlp4, if your
> computation can be done at parse time. We can imagine a syntax
> extension, e.g. "compute" followed by an expression, ask the
> preprocessor to evalutate it and build the syntax tree of the
> result. For example:
>     compute (2*2)
> would generate at parse time:
>     4
> 
> But this could not work:
>     let x = 2 in
>     compute(x*x)
> because the preprocessor does not know what is "x".

To be useful, you would probably also have to be able to define
functions for the preprocessor that could be used to compute the value.

This also makes the interesting possibility of compiles that don't
terminate...

      compute (forever ())

Dave Brown
-------------------
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:[~2002-11-19 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-19  3:18 Jakob Lichtenberg
2002-11-19 11:11 ` Alessandro Baretta
2002-11-20  0:31   ` Pierre Weis
2002-11-20  8:42     ` Alessandro Baretta
2002-11-19 11:12 ` Daniel de Rauglaudre
2002-11-19 18:09   ` David Brown [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=20021119180900.GA24889@opus.davidb.org \
    --to=caml-list@davidb.org \
    --cc=caml-list@inria.fr \
    --cc=daniel.de_rauglaudre@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).