From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C9939BC0B for ; Fri, 15 Dec 2006 08:49:49 +0100 (CET) Received: from mxfep03.bredband.com (mxfep03.bredband.com [195.54.107.76]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBF7nn3B017440 for ; Fri, 15 Dec 2006 08:49:49 +0100 Received: from ironport.bredband.com ([195.54.107.82] [195.54.107.82]) by mxfep03.bredband.com with ESMTP id <20061215074946.TFXF2993.mxfep03.bredband.com@ironport.bredband.com> for ; Fri, 15 Dec 2006 08:49:46 +0100 Received: from c-0c8ae253.09-253-7570701.cust.bredbandsbolaget.se (HELO [192.168.0.45]) ([83.226.138.12]) by ironport.bredband.com with ESMTP; 15 Dec 2006 08:49:46 +0100 Message-ID: <45825396.4020900@abc.se> Date: Fri, 15 Dec 2006 08:49:42 +0100 From: Mattias Waldau User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Jacques Garrigue , caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to refactor a large Ocaml program References: <457FF423.7000703@abc.se> <45800CD5.8050401@janestcapital.com> <458106BD.7060103@abc.se> <20061215.140749.85706043.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20061215.140749.85706043.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4582539D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mattias:01 waldau:01 mattias:01 waldau:01 refactor:01 ocaml:01 ocaml:01 syntax:01 typecheck:01 impl:01 emacs:01 navigate:98 wrote:01 caml-list:01 functions:01 Hi Jacques, Thank you for the tip. I think we are talking about different things. Since there is no refactoring I will have to settle for something simpler. A nice thing would be to be able to navigate the program, i.e. 1. Goto to definition (Ctrl-B in Visual Studio) 2. Find usage. (Alt-F7 in Resharper) A enhanced .annot file as described below would enable that for compiled programs. (Resharper and similar tools makes it work for non-compilable programs.) -- Mattias Jacques Garrigue wrote: > From: Mattias Waldau > >> 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 >