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=AWL,HTML_MESSAGE 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 340EDBC6B for ; Wed, 23 May 2007 17:11:24 +0200 (CEST) Received: from smtp.janestcapital.com (www.janestcapital.com [66.155.124.107]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4NFBMpn020799 for ; Wed, 23 May 2007 17:11:23 +0200 Received: from [172.25.129.161] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id A9970308; Wed, 23 May 2007 11:11:19 -0400 Message-ID: <4654598D.3010200@janestcapital.com> Date: Wed, 23 May 2007 11:11:09 -0400 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Florian Hars Cc: OCaml Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve. References: <1179871823.6966.78.camel@Blefuscu> <1179875804.17533.33.camel@rosella.wigram> <20070523091909.GA8019@snarc.org> <46543875.9010305@janestcapital.com> <465455B7.50106@bik-gmbh.de> In-Reply-To: <465455B7.50106@bik-gmbh.de> Content-Type: multipart/alternative; boundary="------------030209090905030505050009" X-j-chkmail-Score: MSGID : 4654599A.000 on concorde : j-chkmail score : XX : 5/20 0 0.000 -> 2 X-Miltered: at concorde with ID 4654599A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hars:01 mli:01 mli:01 ocamlc:01 hars:01 ocamlc:01 wrote:01 wrote:01 caml-list:01 compiles:01 compiles:01 expression:02 expression:02 face:97 face:97 This is a multi-part message in MIME format. --------------030209090905030505050009 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Florian Hars wrote: >Brian Hurt schrieb: > > >>Hundreds of lines? I've seen ten's of lines, but never hundreds. >> >> > >Not only hundreds of lines, but usually in a completely different file, too. > >This expression has type exactly_what_it_should be, but is here used with >type compeletly_off_the_mark. > >How I hate it. > > > .mli files. Use them. Trust me. Simply because code compiles doesn't necessarily mean it's right. Often times I write the .mli file first, as it's a convient level to think about what the interface to a module should be. But at the very least you should use ocamlc -i to generate the .mli file when you are more or less done with the module, and then hand verify it as correct. And then keep it around, to make sure the module remains correct in the face of future changes. Doing this will keep type errors in the same file, at least. Brian --------------030209090905030505050009 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Florian Hars wrote:
Brian Hurt schrieb:
  
Hundreds of lines?  I've seen ten's of lines, but never hundreds.
    

Not only hundreds of lines, but usually in a completely different file, too.

This expression has type exactly_what_it_should be, but is here used with
type compeletly_off_the_mark.

How I hate it.

  

.mli files.  Use them.  Trust me.

Simply because code compiles doesn't necessarily mean it's right.  Often times I write the .mli file first, as it's a convient level to think about what the interface to a module should be.  But at the very least you should use ocamlc -i to generate the .mli file when you are more or less done with the module, and then hand verify it as correct.  And then keep it around, to make sure the module remains correct in the face of future changes.  Doing this will keep type errors in the same file, at least.

Brian


--------------030209090905030505050009--