From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA15111 for caml-redistribution@pauillac.inria.fr; Mon, 10 Apr 2000 01:28:09 +0200 (MET DST) Resent-Message-Id: <200004092328.BAA15111@pauillac.inria.fr> 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 RAA25759 for ; Thu, 6 Apr 2000 17:12:38 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA21747; Thu, 6 Apr 2000 17:12:37 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id RAA29691; Thu, 6 Apr 2000 17:12:37 +0200 (MET DST) From: Markus Mottl Message-Id: <200004061512.RAA29691@miss.wu-wien.ac.at> Subject: Re: cyclic value construction ("let rec") To: Xavier.Leroy@inria.fr (Xavier Leroy) Date: Thu, 6 Apr 2000 17:12:36 +0200 (MET DST) Cc: caml-list@inria.fr (OCAML) In-Reply-To: <20000406162552.49765@pauillac.inria.fr> from "Xavier Leroy" at Apr 06, 2000 04:25:52 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 10 Apr 2000 01:28:09 +0200 Resent-To: caml-redistribution@pauillac.inria.fr > Alas, it can do a lot of harm. For one thing, you could break type > safety this way, just like with polymorphic references: Oh, right... - I could have thought earlier of this eternal problem of destructive update and polymorphic typing! Once again it seems to me that there is little place to "wiggle" at the current implementation of the typing discipline without losing its important properties... So my "quick hack" version is indeed potentially explosive and will only work correctly (= type safe) as long as the user does not put polymorphic values into the datastructure and does not do "evil" things then. It would be possible to allow this "const cast" with records that have a non-parameterized type - which would be pretty boring and might possibly make the language less regular: beginners might be confused why "casting away" mutability is allowed in some cases but not in others. Best regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl