Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* camlp4 3.10: <:ctyp< ( $list:tys$ )
@ 2007-05-01 12:16 Joel Reymont
  2007-05-01 12:47 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Reymont @ 2007-05-01 12:16 UTC (permalink / raw)
  To: Caml List

This is the old code:

     | <:ctyp< ( $list:tys$ ) >> -> tupl _loc (List.map aux tys)

I figure it tries to match something like "int * int".

Following Nicolas's suggestion I thought I would see what this  
expands to:

camlp4of -str '<:ctyp< ( int * int ) >>'
Ast.TyTup (_loc,
   Ast.TySta (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, "int")),
     Ast.TyId (_loc, Ast.IdLid (_loc, "int"))))

How do I work back from this to the right expression within parens in  
the original pattern above? I tried

     | <:ctyp< ( $tup:tys$ ) >> -> tupl _loc (List.map aux tys)

but this produces ctyp instead of ctyp list so it's not suitable for  
the tupl.

	Thanks, Joel

--
http://wagerlabs.com/






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

end of thread, other threads:[~2007-05-01 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-01 12:16 camlp4 3.10: <:ctyp< ( $list:tys$ ) Joel Reymont
2007-05-01 12:47 ` [Caml-list] " Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox