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 RAA26639; Tue, 3 Aug 2004 17:10:14 +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 RAA27502 for ; Tue, 3 Aug 2004 17:10:13 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i73FACSH010226 for ; Tue, 3 Aug 2004 17:10:12 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1Bs0vX-0006Wq-00; Tue, 03 Aug 2004 16:10:07 +0100 Date: Tue, 3 Aug 2004 16:10:07 +0100 To: Paul Argentoff Cc: caml-list@inria.fr, ocaml_beginners@yahoogroups.com Subject: Re: [Caml-list] let () = Message-ID: <20040803151007.GA24945@annexia.org> References: <86hdrkth3f.fsf@paul.rtelekom.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86hdrkth3f.fsf@paul.rtelekom.ru> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 410FAAD4.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 2004:99 0400,:01 ignores:01 dynlink:01 syntaxes:01 beginners:01 dbi:99 threads:01 ltd:98 evaluates:01 evaluates:01 ocaml:01 groups:01 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Aug 03, 2004 at 06:46:12PM +0400, Paul Argentoff wrote: > > Hello World! > > Can anyone answer my silly question: what does "let () = bla" really mean? It means "evaluate 'bla' now". In this instance, 'bla' is assumed to be something which evaluates to / returns '()' (ie. the unit value). There is another related syntax: let _ = bla which evaluates 'bla', and ignores the return type of 'bla', whatever it might be. Basically, these constructs are a way to evaluate something at initialization time - usually when the program starts up, or the module is loaded by some other means such as Dynlink. These two syntaxes are equivalent: let _ = f1 (); f2 (); f3 () and: f1 ();; f2 ();; f3 ();; The first is used by people who don't like the ';;' syntax. I've CC'd this message to ocaml-beginners [http://groups.yahoo.com/group/ocaml_beginners/] which is a more appropriate place to discuss this stuff. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment PTHRLIB is a library for writing small, efficient and fast servers in C. HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/ ------------------- 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