English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2009-06-14 (07:55)
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<rathereasy@gmail.com> 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 ("Bar.foo", 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 :