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 F1FC4BC84 for ; Fri, 1 Apr 2005 12:51:28 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j31ApSoW004827 for ; Fri, 1 Apr 2005 12:51:28 +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 MAA30435 for ; Fri, 1 Apr 2005 12:51:28 +0200 (MET DST) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j31ApR8Q005594 for ; Fri, 1 Apr 2005 12:51:27 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 4C84A2BAAF1 for ; Fri, 1 Apr 2005 11:45:04 +0200 (CEST) Message-ID: <424D181F.1040604@barettadeit.com> Date: Fri, 01 Apr 2005 11:45:03 +0200 From: Alex Baretta User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ocaml Subject: Re: [Caml-list] Another polymorphism puzzle References: <891bd339050331180214df95db@mail.gmail.com> <20050401025205.GA4723@cs.brown.edu> <20050401.132956.74753023.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20050401.132956.74753023.garrigue@math.nagoya-u.ac.jp> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 424D27B0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 424D27AF.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 polymorphism:01 renieris:01 foo:01 val:01 foo:01 val:01 bug:01 expr:01 restrictive:01 checker:01 segfault:01 baretta:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: Jacques Garrigue wrote: > From: Manos Renieris > >>Worse: >> >># let f x = { () with foo = 3};; >>val f : 'a -> int t = >># let f x = { 42 with foo = 3};; >>val f : 'a -> int t = >> >>I think this qualifies as a bug. Especially since the documentation >>says the expr on the left hand side of with has to be a record. > > > What do you mean by worse? You just exhibit an immediate consequence > of the typing of f below. I think that "worse" here stands for "completely counterintuitive". > Following the manual, the typing could be more restrictive, but the > current typing is perfectly sound. > > Jacques Garrigue I doubt that any one of us has every written buggy code like the examples in this thread, yet, it it ever happens out of pure thermal agitation in the PS2 cable, I would expect the type checker to track down such "unsound" code, even if it would not cause a segfault. Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) The FreerP Project