Re: Local opening of modules

From: John Prevost (
Date: Tue Nov 10 1998 - 22:22:51 MET

Date: Tue, 10 Nov 1998 16:22:51 -0500 (EST)
From: John Prevost <>
To: Anton Moscal <>
Subject: Re: Local opening of modules
In-Reply-To: <>

On Tue, 10 Nov 1998, Anton Moscal wrote:

> With CamlP4 preprocessor (tool for syntax extension of Ocaml) I got
> this effect by the following grammar extension:

Interesting. I hadn't realized that you could define modules inside let
statements like this:

let f x =
  let module M = struct
                   open Foo;;
                   let v = x + x
  in M.v

(which is exactly what you're doing...)

Actually, the non-sugared form I've written above is pretty satisfactory
all by itself, although not as clean looking as the sugared-up camlp4



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:16 MET