<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/007b9a6049a34f1f9c3132589ab0dc87"
  from="Jan Kybic &lt;kybic@f...&gt;"
  author="Jan Kybic"
  date="2009-01-29T08:44:08"
  subject="Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version?"
  prev="2009/01/daa57075110ea549219cf9b8a4510f2e"
  next="2009/01/df53bfdbdd951319dadbecfe271f6b08"
  prev-in-thread="2009/01/04c0906b6a59f1e853f494c208ff16d4"
  next-in-thread="2009/01/2e9084b6eb8b9af0a94ce04412a520d9"
  prev-thread="2009/01/e09599b965f7f3400e85b669e98f0ce5"
  next-thread="2009/01/f5bd2d6c64c874aac998705e20700717"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Conditional compilation wrt OCaml version?">
<msg 
  url="2009/01/0a0fe39588aae49654160bac6ca678bc"
  from="David Rajchenbach-Teller &lt;David.Teller@e...&gt;"
  author="David Rajchenbach-Teller"
  date="2009-01-26T21:24:59"
  subject="Conditional compilation wrt OCaml version?">
<msg 
  url="2009/01/04c0906b6a59f1e853f494c208ff16d4"
  from="Sylvain Le Gall &lt;sylvain@l...&gt;"
  author="Sylvain Le Gall"
  date="2009-01-26T21:40:50"
  subject="Re: Conditional compilation wrt OCaml version?">
<msg 
  url="2009/01/007b9a6049a34f1f9c3132589ab0dc87"
  from="Jan Kybic &lt;kybic@f...&gt;"
  author="Jan Kybic"
  date="2009-01-29T08:44:08"
  subject="Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version?">
<msg 
  url="2009/01/2e9084b6eb8b9af0a94ce04412a520d9"
  from="Jérémie Dimino &lt;jeremie@d...&gt;"
  author="Jérémie Dimino"
  date="2009-01-29T13:00:20"
  subject="Re: [Caml-list] Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version?">
</msg>
</msg>
<msg 
  url="2009/01/2ab9cc0e7892983f6930f81e8d176fb6"
  from="David Rajchenbach-Teller &lt;David.Teller@e...&gt;"
  author="David Rajchenbach-Teller"
  date="2009-01-29T09:21:30"
  subject="Re: [Caml-list] Re: Conditional compilation wrt OCaml version?">
</msg>
</msg>
<msg 
  url="2009/01/92af918d7c74f305f5057380084d1039"
  from="Mikkel_Fahnøe_Jørgensen &lt;mikkel@d...&gt;"
  author="Mikkel_Fahnøe_Jørgensen"
  date="2009-01-26T22:58:32"
  subject="Re: [Caml-list] Conditional compilation wrt OCaml version?">
</msg>
</msg>
</thread>

<contents>
&gt;&gt;   Working on Batteries, we're faced with a few places where we'd like to
&gt;&gt; perform conditional compilation depending on the version of OCaml being
&gt;&gt; used. We could probably do this with Camlp4, cpp, Autoconf hackery, etc.
&gt;&gt; -- but first, we need to decide on which of these options we'll adopt.
&gt;&gt;
&gt;
&gt; There is optcomp:
&gt; https://forge.ocamlcore.org/projects/optcomp/
&gt; http://darcs.ocamlcore.org/repos/optcomp/optcomp/README
&gt;

Good morning. I have looked at ocamlopt and it looks very useful. 
Are there any plans to include macro expansion in ocamlopt?
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.

Besides conditional compilation - to try different variants of the
code or to have debugging messages which can be switched off without
any performance penalty - I would also like to use it for short pieces
of compile-time generated code (for speed up). Currently, I use a
Python-based templating system em.py
(http://www.alcyone.com/pyos/empy/) for this purpose. This works but
combining the way Python and Ocaml syntax is sometimes not very
intuitive.

It appears that a modern and universal tool for compile-time code
generation is MetaOcaml. However, is there a way in MetaOcaml to
generate the code just once and not every time the program is run? I
mean, can the code fragments be cached - saved into a file (a shared library?)
and later retrieved?

Thanks,

Jan

-- 
-------------------------------------------------------------------------
Jan Kybic &lt;kybic@fel.cvut.cz&gt;                       tel. +420 2 2435 5721
http://cmp.felk.cvut.cz/~kybic                      ICQ 200569450

</contents>

</message>

