caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Camlp4: type declaration quotation
@ 2007-07-13 15:51 Dmitry Bely
  0 siblings, 0 replies; only message in thread
From: Dmitry Bely @ 2007-07-13 15:51 UTC (permalink / raw)
  To: Caml List

Suppose I have

EXTEND Gram
  str_item:
    [ [ "type"; tdl = LIST1 type_declaration SEP "and" ->
...

How to de-construct tdl elements? Specifically I would like to get the
same type here as with the old Camlp4. I am thinking of something like

let tdl = List.map (fun [<:ctyp< type ... >> -> ... | _ -> assert False]) tdl in
...

But how to use <:ctyp< type ... >> ? The only mention in the docs is

<:ctyp< type t 'a 'b 'c = t constraint t = t constraint t = t >>
Type declaration
TyDcl of Loc.t and string and list ctyp and ctyp and list (ctyp * ctyp)

Can you explain what it means and give any example?

- Dmitry Bely


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-13 15:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-13 15:51 Camlp4: type declaration quotation Dmitry Bely

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).