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 AAA11720; Thu, 26 Jul 2001 00:27:49 +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 AAA11710 for ; Thu, 26 Jul 2001 00:27:48 +0200 (MET DST) Received: from localhost.localdomain (ppp1.dyn147.pacific.net.au [210.23.147.1]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6PMRjH01447; Thu, 26 Jul 2001 00:27:45 +0200 (MET DST) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id IAA03964; Thu, 26 Jul 2001 08:27:38 +1000 Message-ID: <3B5F47DA.BAB6E25B@maxtal.com.au> Date: Thu, 26 Jul 2001 08:27:38 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Xavier Leroy CC: Markus Mottl , OCAML Subject: Re: [Caml-list] illegal permutation of structure fields? References: <20010723150428.B12189@chopin.ai.univie.ac.at> <20010723172755.A5259@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy wrote: > > > I've just found out to my surprise that the following does not work: [] > > This yields the following error: > > Illegal permutation of structure fields > > > > Why is this illegal? Wouldn't it be very straightforward to normalize > > the signatures (e.g. sort elements by name) before matching them? > > That's more or less what old versions of OCaml did, but it's > incorrect. The reason is that a module signature determine the layout > of the corresponding structure: if [] I don't understand this explanation. Markus suggested _normalising_ the order by name. That is, the 'actual' storage order of elements is determined by their names, not by the order of writing. -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 New generation programming language Felix http://felix.sourceforge.net Literate Programming tool Interscript http://Interscript.sourceforge.net ------------------- 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