| Anonymous | Login | Signup for a new account | 2013-05-19 02:30 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004648 | OCaml | OCaml general | public | 2008-11-17 23:08 | 2011-06-04 09:32 | |||
| Reporter | mottl | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | feature | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11.0+beta | |||||||
| Target Version | Fixed in Version | 3.12.0 | ||||||
| Summary | 0004648: Syntax improvement for easier binding of record fields | |||||||
| Description | It seems to be one of the more frequent annoyances concerning OCaml syntax that record fields can only be bound/matched explicitly, e.g. in the following way: let { Foo. some_long_name = some_long_name; b = b } = my_rec in ... Unless I'm seriously mistaken, it should be very easy to support the following: let { Foo. some_long_name; b } = my_rec in ... Especially in cases where there are many record fields and long names this would substantially reduce the effort of extracting/matching records. This feature wouldn't require any new keywords, wouldn't break existing code, looks very intuitive (AFAIK, SML supports something of that sort), and should be straightforward to implement. Could you please consider this for inclusion in a future OCaml-release? | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0004772) oandrieu (reporter) 2008-11-21 14:05 |
FYI, I did a camlp4 syntax extension doing exactly this a couple years ago: http://oandrieu.nerim.net/ocaml/#pa_records [^] (/!\ it's not a 3.10-camlp4 extension) It's useful in record expression too (when building a record): let b = ... in let some_long_name = ... in { some_long_name ; b } |
|
(0004773) mottl (reporter) 2008-11-21 15:35 |
Right, record construction should, of course, be treated in the same uniform way, too. |
|
(0005963) Christophe Troestler (reporter) 2011-06-02 22:39 |
Shouldn't this be closed? The requested feature is indeed available in 3.12. |
|
(0005966) xleroy (administrator) 2011-06-04 09:32 |
Christophe is right: this wish was granted in 3.12.0. Closing the PR. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2008-11-17 23:08 | mottl | New Issue | |
| 2008-11-21 14:05 | oandrieu | Note Added: 0004772 | |
| 2008-11-21 15:35 | mottl | Note Added: 0004773 | |
| 2008-12-03 14:12 | doligez | Status | new => acknowledged |
| 2011-06-02 22:39 | Christophe Troestler | Note Added: 0005963 | |
| 2011-06-04 09:32 | xleroy | Note Added: 0005966 | |
| 2011-06-04 09:32 | xleroy | Status | acknowledged => closed |
| 2011-06-04 09:32 | xleroy | Resolution | open => fixed |
| 2011-06-04 09:32 | xleroy | Fixed in Version | => 3.12.0 |
| Copyright © 2000 - 2011 MantisBT Group |