From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 50DEFBBFA for ; Mon, 20 Jun 2005 22:08:09 +0200 (CEST) Received: from salt.cs.brown.edu (salt.cs.brown.edu [128.148.32.122]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5KK88o9032234 for ; Mon, 20 Jun 2005 22:08:09 +0200 Received: from localhost (localhost [127.0.0.1]) by salt.cs.brown.edu (Postfix) with ESMTP id 81745386475 for ; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Received: from salt.cs.brown.edu ([127.0.0.1]) by localhost (salt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31371-09 for ; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by salt.cs.brown.edu (Postfix) with ESMTP id 64BC738646E for ; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Received: from point.cs.brown.edu (point [128.148.33.31]) by null.cs.brown.edu (Postfix) with ESMTP id 55F52148010 for ; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Received: by point.cs.brown.edu (Postfix, from userid 30102) id 4E8FF7DE4; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by point.cs.brown.edu (Postfix) with ESMTP id 4D7A7454A4 for ; Mon, 20 Jun 2005 16:08:08 -0400 (EDT) Date: Mon, 20 Jun 2005 16:08:08 -0400 (EDT) From: "Nathaniel J. Gaylinn" X-X-Sender: ngaylinn@point To: caml-list@yquem.inria.fr Subject: OCaml IDE (Camlp4 for code formatting) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.brown.edu X-Miltered: at concorde with ID 42B72228.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 trivial:01 ocaml:01 snippets:01 syntax:01 syntax:01 binary:01 eating:98 tree:02 tree:02 expressions:03 let:03 indentation:04 meant:05 problem:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: One feature I want my program to have is autoformatting, that is, the ability to go through and indent source code for you in some standard way. At first glance, OCamlp4 seemed like the way to go for this, but under further inspection I'm not sure this is true. My main problem with OCamlp4 is that it changes the input source code! Expressions like "5;;" that are just used for side effect are replaced with "let _ = 5;;" which is equivalent, but different code. I understand why it makes this change, but since my program is intended for students the last thing I want is for it to change their code, even in a trivial way such as this. Also, I'm pretty sure I've observed OCamlp4 eating comments, which obviously is no good. Is there a nice way to get OCamlp4 not to change the source code it's given in any way except for spacing? Is there some other convenient way to autoformat OCaml source? Is there a documented standard of what properly formatted OCaml code should look like? It's hard to derive a set of indentation rules just from anecdotal code snippets. On a similar note, is there any reference to the format in which Camlp4 outputs its syntax tree? I might be able to use the syntax tree for formatting and other purposes in my ide, but I can't at all read the binary format it spits out. Is this something easy to read, or is it only meant to be accessed by OCaml itself? Thanks, -- Nate Gaylinn