From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA07237; Wed, 13 Nov 2002 15:48:22 +0100 (MET) 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 PAA07223 for ; Wed, 13 Nov 2002 15:48:22 +0100 (MET) Received: from indyio.rz.uni-sb.de (indyio.rz.uni-saarland.de [134.96.7.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gADEmL101257 for ; Wed, 13 Nov 2002 15:48:21 +0100 (MET) Received: from mars.rz.uni-saarland.de (IDENT:N3Y+gOD/LgnaaSjuEf21R0LblIv6+k39@mars.rz.uni-saarland.de [134.96.7.4]) by indyio.rz.uni-sb.de (8.9.3/8.9.3) with ESMTP id PAA17518662 for ; Wed, 13 Nov 2002 15:48:20 +0100 (CET) Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by mars.rz.uni-saarland.de (8.8.8/8.8.4/8.8.2) with ESMTP id PAA253550430 for ; Wed, 13 Nov 2002 15:48:14 +0100 (CET) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.12.6/2002101000) with ESMTP id gADEmEL7007743; Wed, 13 Nov 2002 15:48:14 +0100 (CET) Received: from mail.cs.uni-sb.de (IDENT:GTKlqicXo2gXXjyP8ZKjSYPI+FMfWWXA@mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.12.1/2002101000) with ESMTP id gADEmDf03390; Wed, 13 Nov 2002 15:48:13 +0100 (CET) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.12.6/2002101500) with ESMTP id gADEmBiB011298; Wed, 13 Nov 2002 15:48:11 +0100 (CET) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.6/8.11.0) with ESMTP id gADEmBG08685; Wed, 13 Nov 2002 15:48:11 +0100 Message-ID: <3DD2662B.288912D3@ps.uni-sb.de> Date: Wed, 13 Nov 2002 15:48:11 +0100 From: Andreas Rossberg Organization: =?iso-8859-1?Q?Universit=E4t?= des Saarlandes X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.9-21 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: Jacques Garrigue CC: caml-list@inria.fr Subject: Re: [Caml-list] Records typing References: <3DCF97ED.6E81EB98@ps.uni-sb.de> <20021113101131D.garrigue@kurims.kyoto-u.ac.jp> <20021113114105Z.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue wrote: > > > # module M' = struct type t = float type r = {f : t} end;; > > module M' : sig type t = float and r = { f : t; } end > > There is actually a bug: depending on what is the definition, it is > either in the interpretation of type declaration or in the > pretty-printer. Isn't the problem already appearent on the signature level alone? The original code snippet displayed: > # module type T = sig type t type r = { f : t } end;; > module type T = sig type t and r = { f : t; } end There does not seem to be any distinction being made between recursive and non-recursive type specs in signatures. If that really is the case, isn't it somewhat incompatible with the treatment of type definitions, where recursion can trigger boxing? That probably is the origin of the following anomaly: module X = struct type t = float type r = {f:t} end module X1 = (X : sig type t = float type r = {f:t} end) module X2 = (X : sig type t type r = {f:t} end with type t = float) X1 is accepted, but X2 isn't. Maybe I'm wrong, but I believe the whole problem can be circumvented (or it least be simplified) by basing the decision when to unbox on a pure syntactic criterion, rather than a semantic one. What I mean is, only unbox when the types of the record fields are syntactically declared to be float. A signature using an abbreviation and one using float directly for a record field would not be compatible. That keeps out recursion issues and is consistent with the treatment of constructor arity. - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids; I mean if Pac Man affected us as kids, we would all be running around in darkened rooms, munching magic pills, and listening to repetitive electronic music." - Kristian Wilson, Nintendo Inc. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners