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 UAA08542; Wed, 8 Oct 2003 20:28:21 +0200 (MET DST) 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 UAA22814 for ; Wed, 8 Oct 2003 20:28:20 +0200 (MET DST) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h98ISI109167 for ; Wed, 8 Oct 2003 20:28:18 +0200 (MET DST) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id h98ISIcp011618 ; Wed, 8 Oct 2003 20:28:18 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id h98ISFhK013159 ; Wed, 8 Oct 2003 20:28:15 +0200 (MET DST) X-Authentication-Warning: clipper.ens.fr: frisch owned process doing -bs Date: Wed, 8 Oct 2003 20:28:15 +0200 (MET DST) From: Alain.Frisch@ens.fr X-X-Sender: frisch@clipper.ens.fr Reply-To: Alain.Frisch@ens.fr To: Andreas Rossberg cc: caml-list@inria.fr Subject: Re: [Caml-list] Constructors as functions and tuples in constructors In-Reply-To: <3F843C6E.8060407@ps.uni-sb.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; alain:01 frisch:01 caml-list:01 rossberg:01 runtime:01 alain:01 compiler:01 typechecking:01 constructors:01 constructors:01 trivial:01 wrote:03 oct:03 let:04 pair:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 8 Oct 2003, Andreas Rossberg wrote: > That is not true. It would be quite trivial for the compiler to translate > > A z -> e > > into the equivalent of > > A(z1,z2) -> let z = (z1,z2) in e Maybe: A _ as z -> e would be enough (well, not for typechecking, of course) and avoid an extra allocation. The idea is that any piece of code working on a pair (z1,z2) can also work on A(z1,z2) since the runtime repsentation is the same, except the tag which is not used. -- Alain ------------------- 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