Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006054OCamlOCaml generalpublic2013-06-27 16:362014-02-04 17:55
Reporterkaustuv 
Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target Version4.01.1+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.
Tagspatch
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

-  Notes
(0009669)
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).

(0010836)
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.
(0010861)
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!
(0010879)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker