From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7DB0FBB84 for ; Thu, 29 Jan 2009 14:00:20 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAGs3gUnVuiYS/2dsb2JhbADLdoQOBg X-IronPort-AV: E=Sophos;i="4.37,344,1231110000"; d="scan'208";a="23259272" Received: from solaria.dimino.org ([213.186.38.18]) by mail1-smtp-roc.national.inria.fr with ESMTP; 29 Jan 2009 14:00:20 +0100 Received: by solaria.dimino.org (Postfix, from userid 1000) id DBD1A8004E; Thu, 29 Jan 2009 14:00:19 +0100 (CET) From: =?utf-8?B?SsOpcsOpbWll?= Dimino To: Jan Kybic Cc: caml-list@inria.fr Subject: Re: [Caml-list] Ocamlopt+macros, caching MetaOcaml code. Was: Conditional compilation wrt OCaml version? References: <1233005104.20843.25.camel@Blefuscu> <87vdrya4dt.fsf_-_@fel.cvut.cz> Mail-Followup-To: Jan Kybic , caml-list@inria.fr Date: Thu, 29 Jan 2009 14:00:30 +0100 In-Reply-To: <87vdrya4dt.fsf_-_@fel.cvut.cz> (Jan Kybic's message of "Thu, 29 Jan 2009 09:43:58 +0100") Message-ID: <87d4e6tggh.fsf@dimino.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocamlopt:01 caching:01 metaocaml:01 compilation:01 ocaml:01 ocamlopt:01 compilation:01 merging:01 tokens:01 compile:01 incompatible:01 caml-list:01 macros:01 macros:01 writes:01 Jan Kybic writes: > Good morning. I have looked at ocamlopt and it looks very useful.=20 > 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=20 > 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 =3D x | | #if y | ... | #endif `---- the error would be raised at the "#if y" line. Whereas it is raised at the "#let y =3D x" line with optcomp. That is mostly why i decided not to design it as a macro expansion system. J=C3=A9r=C3=A9mie