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=1.0 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 2C610BBC4 for ; Tue, 14 Apr 2009 21:57:48 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsDAOOH5EnUGyoBlGdsb2JhbACBUpQ9AQEBAQkLCAkRA7pPg3wG X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27678167" Received: from smtp1-g21.free.fr ([212.27.42.1]) by mail1-smtp-roc.national.inria.fr with ESMTP; 14 Apr 2009 21:57:47 +0200 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id 3DF0B940157; Tue, 14 Apr 2009 21:57:40 +0200 (CEST) Received: from macbookpro.local (lns-bzn-48f-81-56-220-129.adsl.proxad.net [81.56.220.129]) by smtp1-g21.free.fr (Postfix) with ESMTP id 2230B94017A; Tue, 14 Apr 2009 21:57:38 +0200 (CEST) Message-ID: <49E4EBA1.1040206@univ-savoie.fr> Date: Tue, 14 Apr 2009 22:01:37 +0200 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Yoann Padioleau Cc: Goswin von Brederlow , caml-list@inria.fr Subject: Re: [Caml-list] pattern matching and records vs tuples References: <87skkbuxx8.fsf@aryx.cs.uiuc.edu> <87tz4ryyrb.fsf@frosties.localdomain> <87myajuq8d.fsf@aryx.cs.uiuc.edu> In-Reply-To: <87myajuq8d.fsf@aryx.cs.uiuc.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 compiler:01 cheers:01 integer:01 caml-list:01 tuples:01 int:01 data:02 let:03 let:03 pattern:04 Dear list member, A solution when you change a record (or the meaning of an integer) and want to make sure that you are warned by the compiler at every place where this data is used is to encapsulate your type in a box replacing for instance let x = 0 : int (number of eggs) with let box d = `A(d) and unbox (`A d) = d let x = box 0 (*nomber of dozen of eggs*) Once you have updated all your code, you can remove the "box" and "unbox". It would be nice if all this could be automated ... Cheers, Christophe