Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004263OCaml-for Camlp4 use 19:492010-04-29 14:18
Assigned Toertai 
PlatformOSOS Version
Product Version3.10+dev 
Target VersionFixed in Version3.10+dev 
Summary0004263: AST mapping treats record labels as patterns; should they have type ident instead?
DescriptionCurrently 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)
  ExRec of loc and list (ident * expr) and expr

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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
ertai (developer)
2007-04-20 17:10

That's now done in the CVS for patterns.

So << p1 = p2 >> becomes << i = p >>
ertai (developer)
2007-04-27 11:32

That's now done for expressions too.

I've introduced (as suggested) the rec_binding type.

- Issue History
Date Modified Username Field Change
2007-04-17 19:49 nogin New Issue
2007-04-20 17:10 ertai Note Added: 0004025
2007-04-27 11:32 ertai Note Added: 0004037
2007-04-27 11:33 ertai Assigned To => ertai
2007-04-27 11:33 ertai Status new => resolved
2007-04-27 11:33 ertai Resolution open => fixed
2007-04-27 11:33 ertai Fixed in Version => 3.10+dev
2010-04-29 14:18 xleroy Status resolved => closed
2016-02-08 12:49 doligez Category Camlp4 => for Camlp4 use [^]
2016-02-08 12:50 doligez Category for Camlp4 use [^] => for Camlp4 use [^]
2017-02-23 16:43 doligez Category for Camlp4 use [^] => -for Camlp4 use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker