caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* camlp4 3.10: MLast.type_decl
@ 2007-04-30 12:26 Joel Reymont
  2007-04-30 12:47 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-30 12:26 UTC (permalink / raw)
  To: Caml List

What magic flags do I need to get hold of MLast.type_decl?

This doesn't seem to do it:

ocamlc -c -I +camlp4 -pp camlp4of -for-pack Sexplib pa_sexp_conv.mli
File "pa_sexp_conv.mli", line 38, characters 8-18:
Unbound type constructor MLast.type_decl

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] camlp4 3.10: MLast.type_decl
  2007-04-30 12:26 camlp4 3.10: MLast.type_decl Joel Reymont
@ 2007-04-30 12:47 ` Nicolas Pouillard
  2007-04-30 12:59   ` Joel Reymont
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-30 12:47 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/30/07, Joel Reymont <joelr1@gmail.com> wrote:
> What magic flags do I need to get hold of MLast.type_decl?
>
> This doesn't seem to do it:
>
> ocamlc -c -I +camlp4 -pp camlp4of -for-pack Sexplib pa_sexp_conv.mli
> File "pa_sexp_conv.mli", line 38, characters 8-18:
> Unbound type constructor MLast.type_decl

MLast is the old module that is now replaced by Camlp4.PreCast.Ast

In fact pa_sexp_conv.ml is not yet up to date for OCaml 3.10.

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] camlp4 3.10: MLast.type_decl
  2007-04-30 12:47 ` [Caml-list] " Nicolas Pouillard
@ 2007-04-30 12:59   ` Joel Reymont
  2007-04-30 13:08     ` Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-30 12:59 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Caml List

Nicolas,

On Apr 30, 2007, at 1:47 PM, Nicolas Pouillard wrote:

> MLast is the old module that is now replaced by Camlp4.PreCast.Ast

Just what I've been looking for.

module Ast = Struct.Camlp4Ast.Make Loc;

> In fact pa_sexp_conv.ml is not yet up to date for OCaml 3.10.

I'm trying to update it as a way of learning camlp4.

The issue is with the following...

val add_generator :
   string ->
   (MLast.type_decl -> (MLast.patt * MLast.expr) list *  
MLast.type_decl list)

I'm looking at various *Ast* files under Camlp4/Struct/ but I can't  
figure out the types for the above. Could you point me in the right  
direction?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] camlp4 3.10: MLast.type_decl
  2007-04-30 12:59   ` Joel Reymont
@ 2007-04-30 13:08     ` Nicolas Pouillard
  2007-04-30 13:38       ` Joel Reymont
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-30 13:08 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/30/07, Joel Reymont <joelr1@gmail.com> wrote:
> Nicolas,
>
> On Apr 30, 2007, at 1:47 PM, Nicolas Pouillard wrote:
>
> > MLast is the old module that is now replaced by Camlp4.PreCast.Ast
>
> Just what I've been looking for.
>
> module Ast = Struct.Camlp4Ast.Make Loc;
>
> > In fact pa_sexp_conv.ml is not yet up to date for OCaml 3.10.
>
> I'm trying to update it as a way of learning camlp4.

Hum good idea.

> The issue is with the following...
>
> val add_generator :
>    string ->
>    (MLast.type_decl -> (MLast.patt * MLast.expr) list *
> MLast.type_decl list)
>
> I'm looking at various *Ast* files under Camlp4/Struct/ but I can't
> figure out the types for the above. Could you point me in the right
> direction?

Look at camlp4/Camlp4/Camlp4Ast.partial.ml for the AST.

camlp4/Camlp4/Sig.ml contains almost all signatures.

Here is a traduction of a similar extension:
http://gallium.inria.fr/~pouillar/pub/camlp4/rosetta/pa_json_static/

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] camlp4 3.10: MLast.type_decl
  2007-04-30 13:08     ` Nicolas Pouillard
@ 2007-04-30 13:38       ` Joel Reymont
  2007-04-30 13:41         ` Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-30 13:38 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Caml List


On Apr 30, 2007, at 2:08 PM, Nicolas Pouillard wrote:

> Look at camlp4/Camlp4/Camlp4Ast.partial.ml for the AST.
>
> camlp4/Camlp4/Sig.ml contains almost all signatures.

I understand the "give a man a fish" approach and much prefer to be  
taught fishing.

Next question... Is this the right translation?

(* Old *)

val add_generator :
   string ->
   (MLast.type_decl -> (MLast.patt * MLast.expr) list *  
MLast.type_decl list)
   -> unit

(* New *)

val add_generator :
   string ->
   (ctyp -> (patt * expr) list * ctyp list)
   -> unit

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] camlp4 3.10: MLast.type_decl
  2007-04-30 13:38       ` Joel Reymont
@ 2007-04-30 13:41         ` Nicolas Pouillard
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-30 13:41 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/30/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> On Apr 30, 2007, at 2:08 PM, Nicolas Pouillard wrote:
>
> > Look at camlp4/Camlp4/Camlp4Ast.partial.ml for the AST.
> >
> > camlp4/Camlp4/Sig.ml contains almost all signatures.
>
> I understand the "give a man a fish" approach and much prefer to be
> taught fishing.
>
> Next question... Is this the right translation?
>
> (* Old *)
>
> val add_generator :
>    string ->
>    (MLast.type_decl -> (MLast.patt * MLast.expr) list *
> MLast.type_decl list)
>    -> unit
>
> (* New *)
>
> val add_generator :
>    string ->
>    (ctyp -> (patt * expr) list * ctyp list)
>    -> unit
>

Seems good.

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-04-30 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-30 12:26 camlp4 3.10: MLast.type_decl Joel Reymont
2007-04-30 12:47 ` [Caml-list] " Nicolas Pouillard
2007-04-30 12:59   ` Joel Reymont
2007-04-30 13:08     ` Nicolas Pouillard
2007-04-30 13:38       ` Joel Reymont
2007-04-30 13:41         ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).