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 JAA17895; Thu, 26 Jul 2001 09:18:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA17886 for ; Thu, 26 Jul 2001 09:18:10 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6Q7Elv13955; Thu, 26 Jul 2001 09:14:47 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA17834; Thu, 26 Jul 2001 09:14:47 +0200 (MET DST) Date: Thu, 26 Jul 2001 09:14:46 +0200 From: Xavier Leroy To: Andreas Rossberg Cc: OCAML Subject: Re: [Caml-list] illegal permutation of structure fields? Message-ID: <20010726091446.A17748@pauillac.inria.fr> References: <20010723150428.B12189@chopin.ai.univie.ac.at> <20010723172755.A5259@pauillac.inria.fr> <3B5C4BB0.70D3B74B@ps.uni-sb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3B5C4BB0.70D3B74B@ps.uni-sb.de>; from rossberg@ps.uni-sb.de on Mon, Jul 23, 2001 at 06:07:12PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Then the followup question of course is: isn't it trivial to use a > canonical layout instead, where the tuple components are sorted wrt. to > the corresponding fields' label? This way layout is invariant wrt > permutation in signatures. Or is there a particular problem with such a > scheme? It seems possible to proceed this way; I was just explaining that this is not the way it's currently done in OCaml. In other words, I read Markus' question as "why not compare module types after sorting their components?", and replied to that question, but maybe he meant "why not determine the memory layout of structures after sorting their components?". In the latter case, the answer is that it could probably be done, but I see no real strong need for this (see below). > (BTW, the same holds for record and variant types, where Ocaml does not > allow reordering of fields/constructors either.) Yes, but would this be really useful? Manifest type declarations and manifest module types in signatures must be implemented by the same type/module type declaration in the matching structure. This is generally done by generous cut&paste between the signature and the structure. What would we gain by allowing reordering fields, constructors or module type components? Except making it harder for the programmer to spot mismatches between the two declarations... - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr