Version française
Home     About     Download     Resources     Contact us    
Browse thread
How to refactor a large Ocaml program
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] How to refactor a large Ocaml program
From: Mattias Waldau <mattias.waldau@abc.se>

> One problem with ocaml syntax is the open-statement, i.e. this makes it 
> unclear for an editor
> 
> Ocaml already has the -dtypes. Why doesn't this file contain information 
> about where the functions and types are defined.
> 
> For example, if you have a function call
> 
> open Filename;
> 
> let _ =
> 	concat .........
> 
> in main.ml
> 
> the main.annot contains
> 
> "main.ml" 183 7050 7070 "main.ml" 183 7050 7085
> type(
>    string -> string -> string
> )
> 
> An improvement would be if it also contained information about the 
> function, i.e.
> 
> "main.ml" 183 7050 7070 "main.ml" 183 7050 7085
> type(
>    Filename.concat: string -> string -> string
> )
> 
> Then, the editor mode 'M-x goto-tag' or similar could look in the .annot 
> file and open the correct file and go to the definition. (Maybe more 
> information than Filename.concat is needed).

FYI, ocamlbrowser can already do that: open your file, typecheck it,
double-click on an identifier, and use the "impl" button in the type
browser.
It would not be much more difficult to do it in emacs, I suppose.

   Jacques Garrigue