Re: [Caml-list] let () =
- On Tue, Aug 03, 2004 at 06:46:12PM +0400, Paul Argentoff wrote:
>It means "evaluate 'bla' now". In this instance, 'bla' is assumed to
> Hello World!
> Can anyone answer my silly question: what does "let () = bla" really mean?
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 _ =
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/%5d which is a more
appropriate place to discuss this stuff.
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/