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 WAA09616; Tue, 2 Apr 2002 22:10:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA09085 for caml-list@pauillac.inria.fr; Tue, 2 Apr 2002 22:10:22 +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 GAA15190 for ; Tue, 2 Apr 2002 06:15:16 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from sj1-3-4-9.securesites.net (sj1-3-4-9.securesites.net [192.220.127.202]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g324FEX27647 for ; Tue, 2 Apr 2002 06:15:15 +0200 (MET DST) Received: (qmail 9284 invoked by uid 16863); 2 Apr 2002 04:08:32 -0000 Received: from unknown (HELO localhost) ([192.220.65.223]) (envelope-sender ) by 192.220.65.223 (qmail-ldap-1.03) with SMTP for ; 2 Apr 2002 04:08:32 -0000 Date: Tue, 2 Apr 2002 04:08:32 +0000 (GMT) From: Brian Rogoff To: Richard Nyberg cc: caml-list@inria.fr Subject: Re: [Caml-list] let or val in objects In-Reply-To: <20020331224051.A5546@gromit.it.su.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk One place where you may notice that lets are used is when you have a bunch of instance variables that depend on other instance variables for their definition. For instance this code (not checked, posting from wife's OCamlless machine :() class foo = object val s = "test" val l = String.length s end won't compile because of the dependence of l on s. This example is clearly contrived, but if you do GUI programming this sort of situation occurs frequently. -- Brian ------------------- 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