caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@mail4.ai.univie.ac.at>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Andreas Rossberg <rossberg@ps.uni-sb.de>, OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] illegal permutation of structure fields?
Date: Thu, 26 Jul 2001 10:42:37 +0200	[thread overview]
Message-ID: <20010726104237.B4973@kastanie.ai.univie.ac.at> (raw)
In-Reply-To: <20010726091446.A17748@pauillac.inria.fr>; from Xavier.Leroy@inria.fr on Thu, Jul 26, 2001 at 09:14:46 +0200

On Thu, 26 Jul 2001, Xavier Leroy wrote:
> 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).

Yes, that's what I meant. Maybe my question was ill-formulated: in my
first mail I only mentioned signatures and implicitly assumed that the
order of memory layout would follow.

> 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...

I mostly agree on this (what concerns variants and records). I still
think that module types are a bit different, because their purpose is
to abstract, whereas variants and records are concrete representations.
I don't think anybody would be hurt by a more relaxed handling of "law
and order": you can still use cut&paste then, and there is less of a
chance that people run into mile long compiler output due to conflicting
signature definitions. The latter is surely much more difficult to deal
with than comparing two sum type definitions for equality.

Anyway, I don't feel particulary annoyed by the current way things are
handled. It has taken quite a while before I even noticed this kind
of behaviour...

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
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


  reply	other threads:[~2001-07-26  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-23 13:04 Markus Mottl
2001-07-23 15:27 ` Xavier Leroy
2001-07-23 16:07   ` Andreas Rossberg
2001-07-26  7:14     ` Xavier Leroy
2001-07-26  8:42       ` Markus Mottl [this message]
2001-07-23 16:36   ` Markus Mottl
2001-07-25 22:27   ` John Max Skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010726104237.B4973@kastanie.ai.univie.ac.at \
    --to=markus@mail4.ai.univie.ac.at \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=rossberg@ps.uni-sb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).