Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006054OCaml~DO NOT USE (was: OCaml general)public2013-06-27 16:362014-10-28 16:24
Assigned To 
PlatformOSOS Version
Product Version4.00.1 
Target Version4.02.0+devFixed in Version 
Summary0006054: Also support M.[] and M.{} like M.()
DescriptionI am madly in love with the M.() notation. The only way it could be better if it were also possible to write M.[] and M.{} instead of M.([]) and M.({}). Among other issues, these latter forms cause more indentation than desired in the various ocaml Emacs modes and indentation tools for the contents inside teh brackets/braces.

From a brief perusal of parser.mly, there seems to be no conflicts with adding productions beginning with mod_longident DOT to simple_expr for these cases. However, there will be duplication of code in parser.mly and possibly in the concrete syntax tree and/or in CamlP4 for these new constructs.

Also worth considering M.[| |], M.{< >}, etc. although I can't honestly remember if I've ever used these forms.
Attached Filespatch file icon more_module_dot_abbreviations.patch [^] (2,619 bytes) 2013-06-29 11:01 [Show Content]
patch file icon more_module_dot_abbreviations_20140123.patch [^] (3,258 bytes) 2014-01-23 11:12 [Show Content]

- Relationships
related to 0006635closedyallop Support local open syntax for empty delimiters M.[], M.() etc. 

-  Notes
doligez (administrator)
2013-07-02 14:15
edited on: 2014-01-30 11:14

I'm in favour, including M.[||] (doesn't make sense to have it for lists and not arrays) and M.{<>} (for completeness).

kaustuv (reporter)
2014-01-23 11:14

OK, I've updated the patch with M.[| |] and M.{< >} as well and rebased it on top of trunk as of 2014-01-23.

Note: the patch is only a proof of concept. It only extends the parser, and does not add any unit tests, nor does it touch Camlp4. It should probably be rewritten/extended to follow your coding guidelines.
trefis (reporter)
2014-01-29 21:29

> nor does it touch Camlp4.

But camlp4 now lives outside of the ocaml repository, so your patch should be merged (if people like it, of course) regardless of the status of camlp4, right?

PS: I really like the proposition!
gasche (developer)
2014-02-04 17:55

Patch applied in trunk, thanks!

- Issue History
Date Modified Username Field Change
2013-06-27 16:36 kaustuv New Issue
2013-06-29 11:01 kaustuv File Added: more_module_dot_abbreviations.patch
2013-07-02 14:15 doligez Note Added: 0009669
2013-07-02 14:15 doligez Status new => confirmed
2013-07-02 14:15 doligez Target Version => 4.02.0+dev
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev
2014-01-17 15:17 doligez Tag Attached: patch
2014-01-23 11:12 kaustuv File Added: more_module_dot_abbreviations_20140123.patch
2014-01-23 11:14 kaustuv Note Added: 0010836
2014-01-29 21:29 trefis Note Added: 0010861
2014-01-30 11:14 doligez Note Edited: 0009669 View Revisions
2014-02-04 17:55 gasche Note Added: 0010879
2014-05-25 20:24 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-16 18:41 doligez Status confirmed => closed
2014-07-16 18:41 doligez Resolution open => fixed
2014-10-28 16:24 yallop Relationship added related to 0006635
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)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker