caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jérémie Dimino" <jeremie@dimino.org>
To: Jan Kybic <kybic@fel.cvut.cz>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version?
Date: Thu, 29 Jan 2009 14:00:30 +0100	[thread overview]
Message-ID: <87d4e6tggh.fsf@dimino.org> (raw)
In-Reply-To: <87vdrya4dt.fsf_-_@fel.cvut.cz> (Jan Kybic's message of "Thu, 29 Jan 2009 09:43:58 +0100")


Jan Kybic <kybic@fel.cvut.cz> writes:

> Good morning. I have looked at ocamlopt and it looks very useful. 
> Are there any plans to include macro expansion in ocamlopt?

Right now there is no plan for that. My only intention when i started
optcomp was conditional compilation, and i made choices making it
incompatible with macro expansion.

By the way, it would be easy to transform it into a macro expansion
system.

> I mean something like merging the functionality of ocamlopt and
> pa_macro but without the restrictions that pa_macro places on 
> where the macro can be used.

Yes, these restrictions could be bypassed because it modify directly the
stream of tokens.

The disadvantage of dealing with macros is for expressions needing to be
evaluated at compile time. For example in that case, assuming the
variable "x" is not defined:

,----
| #let y = x
|
| #if y
| ...
| #endif
`----

the error would be raised at the "#if y" line. Whereas it is raised at
the "#let y = x" line with optcomp. That is mostly why i decided not to
design it as a macro expansion system.

Jérémie


  reply	other threads:[~2009-01-29 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26 21:25 David Rajchenbach-Teller
2009-01-26 21:40 ` Sylvain Le Gall
2009-01-29  8:43   ` Ocamlopt+macros, caching MetaOcaml code. Was: " Jan Kybic
2009-01-29 13:00     ` Jérémie Dimino [this message]
2009-01-29  9:21   ` [Caml-list] " David Rajchenbach-Teller
2009-01-26 22:58 ` [Caml-list] " Mikkel Fahnøe Jørgensen

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=87d4e6tggh.fsf@dimino.org \
    --to=jeremie@dimino.org \
    --cc=caml-list@inria.fr \
    --cc=kybic@fel.cvut.cz \
    /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).