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.3 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id C0821BBAF for ; Tue, 24 Jun 2008 17:55:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEACu2YEjAXQIn/2dsb2JhbACLNadC X-IronPort-AV: E=Sophos;i="4.27,697,1204498800"; d="asc'?scan'208";a="14483911" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Jun 2008 17:54:53 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m5OFsq3H022720 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 24 Jun 2008 17:54:52 +0200 X-IronPort-AV: E=Sophos;i="4.27,697,1204498800"; d="asc'?scan'208";a="14483910" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 24 Jun 2008 17:54:51 +0200 Received: by ausone.inria.fr (sSMTP sendmail emulation); Tue, _d Jun 2008 17:54:26 +0200 From: "Nicolas Pouillard" Cc: Richard Jones , Jeremy Yallop , caml-list Subject: Re: [Caml-list] Custom lexer in Camlp4 To: "Hezekiah M. Carty" References: <4860F097.1000701@ed.ac.uk> <1214317779-sup-8964@port-ext16.ensta.fr> <486104FF.1080201@ed.ac.uk> <20080624151626.GA8424@annexia.org> <3a360f590806240843o3c13ba0dpf5553f49e2355464@mail.gmail.com> In-Reply-To: <3a360f590806240843o3c13ba0dpf5553f49e2355464@mail.gmail.com> Date: Tue, 24 Jun 2008 17:54:26 +0200 Message-Id: <1214322840-sup-3113@port-ext16.ensta.fr> User-Agent: Sup/git Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1214322866-816041-99775-5693-7-="; micalg="pgp-sha1" MIME-Version: 1.0 X-Miltered: at concorde with ID 486118CC.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lexer:01 camlp:01 0100,:01 camlp:01 expr:01 expr:01 syntax:01 wiki:01 toplevel:01 wrote:01 wrote:01 caml-list:01 int:01 int:01 ast:02 X-Attachments: cset="UTF-8" type="application/pgp-signature" name="signature.asc" name="signature.asc" --=-1214322866-816041-99775-5693-7-= Content-Type: text/plain; charset=UTF-8 Excerpts from Hezekiah M. Carty's message of Tue Jun 24 17:43:52 +0200 2008: > On Tue, Jun 24, 2008 at 11:16 AM, Richard Jones wrote: > > On Tue, Jun 24, 2008 at 03:30:23PM +0100, Jeremy Yallop wrote: > > On a related note I had a crazy brainwave that we could use camlp4 to > > use 'ordinary' operators in an overloaded context. Something like: > > > > INT64 (2L * n / 3L) > > > > The INT64(expr) macro would inspect the AST of expr and change + -> > > Int64.add etc. Of course one can do this using the pa_openin macro > > and a module which overrides (+) etc, but maybe this is better? I was > > going to try modifying parts of virt-df to use this syntax to see if > > it would be beneficial. > > I toyed around with a simple extension to the pa_float example on the > camlp4 wiki. The modified version is here: [...] > Sadly camlp4 3.10+ does not play well with the toplevel, so these are > difficult to work with interactively. I do use pa_context in several > places though, and it seems to work well. Can you elaborate on that? -- Nicolas Pouillard aka Ertai --=-1214322866-816041-99775-5693-7-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkhhGLIACgkQj+FCNw9dwLkoPwCghKDdMvalddbXOqP2pojSKGdy 3e8An1dhiw1D431ZOu3WdlHxllVNDSnG =vSms -----END PGP SIGNATURE----- --=-1214322866-816041-99775-5693-7-=--