Version française
Home     About     Download     Resources     Contact us    
Browse thread
Local opening of modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <j.prevost@c...>
Subject: Re: Local opening of modules
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
                 end
  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
stuff.

Thanks!

John.