Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
camlp4 stream parser syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-03-08 (15:39)
From: Joel Reymont <joelr1@g...>
Subject: [Caml-list] Re: camlp4 stream parser syntax

On Mar 8, 2009, at 3:32 PM, Matthieu Wipliez wrote:

> I'd say duplicate Static, and redefine "using". Seems like the  
> simplest solution to me, certainly not the cleanest though (but is  
> there an alternative?).

Now we are talking!

This is

module Make (Lexer : Sig.Lexer)
: Sig.Grammar.Static with module Loc = Lexer.Loc
                       and module Token = Lexer.Token
= struct

   module Structure = Structure.Make Lexer;
   module Delete = Delete.Make Structure;
   module Insert = Insert.Make Structure;
   module Fold = Fold.Make Structure;
   include Structure;
   value get_filter () = gram.gfilter;
   value extend = Insert.extend;

I read the documentation for 'include' but couldn't quite grasp  
whether the included interface was exported from that module that's  
including. Given that 'get_filter' is available but 'using', I reckon  
the answer is NO.

What if Static1 included Static after making it, then included  
Structure again and defined its own using in terms of the one provided  
by Structure?

Mac, C++, OCaml