| Anonymous | Login | Signup for a new account | 2013-05-21 13:22 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 | ||||||
| 0005777 | OCaml | OCaml general | public | 2012-10-07 14:32 | 2012-10-31 17:24 | ||||||
| Reporter | meyer | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | have not tried | ||||||
| Status | new | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 4.00.1 | ||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0005777: Update mode for inferring mli files | ||||||||||
| Description | Some people reported that they want selectively infer signatures for specific entries - value or types by annotating them in some way in the ml file. (e.g 0005764) I'm proposing completely different solution. If somebody specifies something like: ocamlc -infer-update foo.ml when the mli is not present it will create with all the entries like normally -i would normally print. Otherwise it will re-parse the mli file, compare if the signatures change with some specific rules, and then replace these entries but only with the new ones. | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0008369) Bardou (reporter) 2012-10-30 14:42 |
What about the following example: type t = int let f x = x + 1 interface: type t val f: t -> int I now change implementation as follows: type t = float let f x = x +. 1. The inferred type for f is float -> float. How should the .mli be updated? I would like: val f: t -> float But it does not seem easy to decide that we want to keep t. |
|
(0008371) frisch (developer) 2012-10-30 16:37 |
I really don't like the idea that the compiler would parse some source file, modify it, and save it back. I've nothing against an external tool trying to do it properly (preserving the formatting and comments of the original file), but I don't think this is robust enough for a compiler and that we should encourage this workflow. |
|
(0008375) hongboz (developer) 2012-10-31 02:42 |
frisch, I agree with you, how about my proposal? |
|
(0008379) frisch (developer) 2012-10-31 17:24 |
> how about my proposal? Do you mean the "private" syntax proposed in 0005764? I don't have a strong opinion on the subject. For me, having to write the .mli file is not a problem. But it makes sense to have a way to define a structure item for the rest of the module but hide it automatically from the resulting signature. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-10-07 14:32 | meyer | New Issue | |
| 2012-10-07 14:34 | meyer | Description Updated | View Revisions |
| 2012-10-08 02:29 | meyer | Description Updated | View Revisions |
| 2012-10-30 14:42 | Bardou | Note Added: 0008369 | |
| 2012-10-30 16:37 | frisch | Note Added: 0008371 | |
| 2012-10-31 02:42 | hongboz | Note Added: 0008375 | |
| 2012-10-31 17:24 | frisch | Note Added: 0008379 | |
| Copyright © 2000 - 2011 MantisBT Group |