Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006656OCaml~DO NOT USE (was: OCaml general)public2014-11-11 14:032017-09-24 17:32
Reporterhcarty 
Assigned Togarrigue 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.02.1 
Target VersionFixed in Version4.04.0 +dev / +beta1 / +beta2 
Summary0006656: Support Module.[], .{}, etc. in pattern matches
DescriptionWe recently gained support for local module opens for M.[], M.{} and a few similar constructs. It would be nice to have the same support when matching values.
Steps To ReproduceA simple example that does not work with 4.02.1 but would be nice to have:

let c = Complex.{ re = 1.0; im = 1.0 } in match l with Complex.{re} -> re
Tagsjunior_job
Attached Files

- Relationships
has duplicate 0006721closedwhitequark Short form of local open is not available in patterns 

-  Notes
(0012514)
yallop (developer)
2014-11-11 14:06

I'd like to see this as well, but note that the particular example you give can be written equally concisely without the new feature:


   let c = Complex.{ re = 1.0; im = 1.0 } in match c with {Complex.re} -> re
(0012519)
hcarty (reporter)
2014-11-12 03:30

True - I was trying to give a concise example but I probably should have picked something more compelling.
(0014453)
gasche (administrator)
2015-09-16 23:58

There is a pull request to this effect in

  https://github.com/ocaml/ocaml/pull/187 [^]
(0015913)
octachron (developer)
2016-05-10 12:55

The final implementation details are here: https://github.com/ocaml/ocaml/pull/578. [^] This final implementation was merged in trunk at commit 2d33e164a6b636caa5207b765f427360ffb14778.
(0015915)
gasche (administrator)
2016-05-10 13:14

Thanks for the triaging help!
(0015917)
hcarty (reporter)
2016-05-10 15:44

Thanks to everyone involved!

- Issue History
Date Modified Username Field Change
2014-11-11 14:03 hcarty New Issue
2014-11-11 14:06 yallop Note Added: 0012514
2014-11-11 14:09 gasche Tag Attached: junior_job
2014-11-12 03:30 hcarty Note Added: 0012519
2014-11-17 23:41 doligez Status new => acknowledged
2014-12-17 17:41 whitequark Relationship added has duplicate 0006721
2015-09-16 23:58 gasche Note Added: 0014453
2016-05-10 12:55 octachron Note Added: 0015913
2016-05-10 13:14 gasche Note Added: 0015915
2016-05-10 13:14 gasche Status acknowledged => resolved
2016-05-10 13:14 gasche Fixed in Version => 4.04.0 +dev / +beta1 / +beta2
2016-05-10 13:14 gasche Resolution open => fixed
2016-05-10 13:14 gasche Assigned To => garrigue
2016-05-10 15:44 hcarty Note Added: 0015917
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)
2017-09-24 17:32 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker