From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id DD6EEBB84 for ; Wed, 12 Jul 2006 15:56:18 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6CDuIUT012591 for ; Wed, 12 Jul 2006 15:56:18 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA32748 for ; Wed, 12 Jul 2006 15:56:17 +0200 (MET DST) Received: from exchfe2.cs.cornell.edu (exchfenlb-2.cs.cornell.edu [128.84.97.34]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6CDuHdu012572 for ; Wed, 12 Jul 2006 15:56:17 +0200 Received: from exchfe1.cs.cornell.edu ([128.84.97.27]) by exchfe2.cs.cornell.edu with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Jul 2006 09:56:14 -0400 Received: from [192.168.1.100] ([24.59.194.44]) by exchfe1.cs.cornell.edu over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Wed, 12 Jul 2006 09:56:13 -0400 Mime-Version: 1.0 (Apple Message framework v750) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@inria.fr From: Eric Breck Subject: changing the type of records using "with" Date: Wed, 12 Jul 2006 09:56:58 -0400 X-Mailer: Apple Mail (2.750) X-OriginalArrivalTime: 12 Jul 2006 13:56:13.0824 (UTC) FILETIME=[F0273800:01C6A5BA] X-Miltered: at nez-perce with ID 44B4FF82.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44B4FF81.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; foo:01 foo:01 val:01 val:01 ocaml:01 polymorphic:01 cornell:01 typing:01 argument:01 int:01 int:01 string:02 unit:03 let:03 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi folks, I noticed the following behavior of the typing system: # type 'a foo = {a: 'a; b: int};; type 'a foo = { a : 'a; b : int; } # let one = { a = (); b = 5};; val one : unit foo = {a = (); b = 5} # let two = {one with a = "Hello"};; val two : string foo = {a = "Hello"; b = 5} i.e. "{one with ... }" can have a different polymorphic type argument than "one" does. This has been handy for me on a couple of occasions, but is it a documented feature that I can count on working in future versions of ocaml, or is it a quirk of the current version? thanks, Eric Breck