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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 6AE83BC0B for ; Fri, 15 Dec 2006 06:08:16 +0100 (CET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBF58EnD028341 for ; Fri, 15 Dec 2006 06:08:15 +0100 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id kBF581Yu011890; Fri, 15 Dec 2006 14:08:02 +0900 (JST) Date: Fri, 15 Dec 2006 14:07:49 +0900 (JST) Message-Id: <20061215.140749.85706043.garrigue@math.nagoya-u.ac.jp> To: mattias.waldau@abc.se Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to refactor a large Ocaml program From: Jacques Garrigue In-Reply-To: <458106BD.7060103@abc.se> References: <457FF423.7000703@abc.se> <45800CD5.8050401@janestcapital.com> <458106BD.7060103@abc.se> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45822DBE.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; refactor:01 ocaml:01 mattias:01 waldau:01 mattias:01 waldau:01 ocaml:01 syntax:01 typecheck:01 impl:01 emacs:01 caml-list:01 functions:01 defined:02 string:02 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