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 QAA22943; Fri, 22 Oct 2004 16:45:43 +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 QAA23032 for ; Fri, 22 Oct 2004 16:45:42 +0200 (MET DST) Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i9MEjf67027189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Oct 2004 16:45:42 +0200 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.12.4/8.9.2) with ESMTP id i9MEjeUE013619 for ; Fri, 22 Oct 2004 10:45:40 -0400 (EDT) Received: from no-knife.mit.edu (NO-KNIFE.MIT.EDU [18.7.16.64]) (authenticated bits=56) (User authenticated as jfc@ATHENA.MIT.EDU) by outgoing.mit.edu (8.12.4/8.12.4) with ESMTP id i9MEjd1V000158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 22 Oct 2004 10:45:39 -0400 (EDT) Received: (from jfc@localhost) by no-knife.mit.edu (8.12.9) id i9MEjdgS026932; Fri, 22 Oct 2004 10:45:39 -0400 (EDT) Message-Id: <200410221445.i9MEjdgS026932@no-knife.mit.edu> To: "caml-list" Subject: Re: [Caml-list] Polymorphism and the "for" loop In-Reply-To: Your message of "Fri, 22 Oct 2004 07:07:21 PDT." <012676D607FCF54E986746512C22CE7D0FE7C8@orsmsx407> Date: Fri, 22 Oct 2004 10:45:39 -0400 From: John Carr X-Scanned-By: MIMEDefang 2.42 X-Miltered: at concorde with ID 41791D15.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 jfc:01 constr:01 constr:01 ocamlopt:01 asmcomp:01 int:01 rec:01 rec:01 unit:03 unit:03 arguments:03 let:04 let:04 pair:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > # type void = Constr of void;; > type void = Constr of void Given this definition a void value can be constructed as let rec x = Constr x;; or a pair of void values as let rec x = Constr y and y = Constr x;; In response to another message, ocamlopt does not eliminate unit arguments to functions though it does avoid construction of unused unit values within functions[*]. In the machine code for let g (f : unit -> int) = f () the machine value 1 (representing ()) is passed to function f. *See asmcomp/cmmgen.ml function remove_unit. ------------------- 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