caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* 3.10+beta: Camlp4: AST mapping treats record labels as patterns; should they have type ident instead?
@ 2007-04-17 17:50 Aleksey Nogin
  2007-04-18  8:11 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksey Nogin @ 2007-04-17 17:50 UTC (permalink / raw)
  To: Caml List

Currently Camlp4 AST defines the record patterns as

   PaRec of loc and list (patt * patt)

and record expressions as

   ExRec of Loc.t and binding and expr

where the binding can bind arbitrary patterns to expressions. This was 
not a big issue prior to 3.10, but now that 3.10 provides very powerful 
mapping and folding features, this seems a bit problematic. Namely, if I 
define a Camlp4 filter or an AST mapping function that affects patterns, 
the array labels will get affected as well, often in an undesired way.

Would it be better to have
   PaRec of loc and list (ident * patt)
and
   ExRec of loc and list (ident * expr) and expr
instead?

If so, it would seem that now is the time to make the change, as 3.10 is 
about to make major backwards-incompatible camlp4 changes anyway.

Aleksey

P.S. I've also filed this as http://caml.inria.fr/mantis/view.php?id=4263


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

end of thread, other threads:[~2007-05-03  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-17 17:50 3.10+beta: Camlp4: AST mapping treats record labels as patterns; should they have type ident instead? Aleksey Nogin
2007-04-18  8:11 ` [Caml-list] " Nicolas Pouillard
2007-04-18 16:13   ` Aleksey Nogin
2007-04-20 15:17     ` Nicolas Pouillard
2007-05-03  9:16       ` 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).