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, answering my own question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: blue storm <bluestorm.dylc@g...>
Subject: Re: [Caml-list] Camlp4, answering my own question
On Sun, Jun 14, 2009 at 2:31 AM, Jacques Le Normand<> wrote:
> Dear List,
> With regard to the last post, I've found the solution to my problem. The
> parts of the grammar are
> type_longident_and_parameters
> and
> type_ident_and_parameters
> The question is: what's the difference between these two values?

type_ident_... only accepts a lowercase identifier ("foo"), while
type_longident_.. accepts a qualified type identifier ("", and
other strangeties). type_ident_... is used for type declarations, and
type_longident_... is used when referring to an existing type in the
"with ..." module constraint :

  module type A = sig
    module B : sig type t end

  module type C = A with type B.t = int

It's the distinction between "naming objects" (typeconstr-name) and
"referring to named objects" (typeconstr) in the manual :