From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA24827 for caml-redistribution; Wed, 4 Jun 1997 19:26:37 +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 KAA15519 for ; Wed, 4 Jun 1997 10:34:01 +0200 (MET DST) Received: from arthur.u-strasbg.fr (boos@arthur.u-strasbg.fr [130.79.6.103]) by nez-perce.inria.fr (8.8.5/8.7.3) with ESMTP id KAA02625 for ; Wed, 4 Jun 1997 10:33:58 +0200 (MET DST) Received: (from boos@localhost) by arthur.u-strasbg.fr (8.7.5/8.7.3) id MAA15000; Wed, 4 Jun 1997 12:35:41 +0200 Date: Wed, 4 Jun 1997 12:35:41 +0200 Message-Id: <199706041035.MAA15000@arthur.u-strasbg.fr> From: Christian Boos MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: partial instantiation of a new obj. : bug or feature ? X-Mailer: VM 6.22 under 19.15p4 XEmacs Lucid Sender: weis Hi, It seems that partial instantiation of objects' new statement didn't work as I expected. I thought that the creation of an object takes place when all the arguments are available. The following example illustrates this: # class test (a : int) (b : int) = val a = a val b = b method get = (a, b) end;; class test (int) (int) = val a : int val b : int method get : int * int end # let a1 = new test 1;; val a1 : int -> test = # let b1 = a1 1;; val b1 : test = # let b2 = a1 2;; val b2 : test = # b1 = b2;; - : bool = true # b1#get;; - : int * int = 1, 2 # b2#get;; - : int * int = 1, 2 # This forces one to write things like : let objs = Array.map (fun i -> new test 1 i) vals instead of the more intuitive : let objs = Array.map (new test 1) vals Maybe someone wants to comment ? -- Christian