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 HAA26892; Fri, 4 Apr 2003 07:59:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 HAA26582 for ; Fri, 4 Apr 2003 07:59:04 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from www.duonix.com ([210.113.163.221]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h345x1925317 for ; Fri, 4 Apr 2003 07:59:02 +0200 (MET DST) Received: from hama ([192.168.0.254]) by www.duonix.com (8.12.8/8.11.6) with SMTP id h3465NO9017154; Fri, 4 Apr 2003 15:05:23 +0900 (KST) (envelope-from shoh@duonix.com) Message-ID: <006901c2fa6f$4dcb5400$fe00a8c0@hama> From: "SooHyoung Oh" To: "Seth Kurtzberg" , References: <20030403223536.0ddb42b2.seth@cql.com> Subject: Re: [Caml-list] Objects and Initializers Date: Fri, 4 Apr 2003 14:59:07 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam: no; 0.00; caml-list:01 val:01 661:99 bug:01 faq:01 beginner's:01 beginners:01 bin:01 480:98 caml-bugs:01 ocaml:01 caml:01 mutable:01 int:01 groups:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk You can declare a class with argument like this: class box i = object(self) val num = i method print = print_int num end;; let _ = let b = new box 7 in b # print; print_string "\n" --- SooHyoung Oh ----- Original Message ----- From: "Seth Kurtzberg" To: Sent: Friday, April 04, 2003 2:35 PM Subject: [Caml-list] Objects and Initializers > Hello, list: > > >From the docs it appears that object initializers cannot take arguments. Is there a way to accomplish the same thing? I want to assign values to instance variables without having to make them mutable. > > -- > Seth Kurtzberg > MIS Corp > 480-661-1849 > seth@cql.com > > ------------------- > 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 > ------------------- 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