Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] baffled by semicolon
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Radu Grigore <radugrigore@g...>
Subject: Re: Baffeld by manual (Was: [Caml-list] baffled by semicolon)
On 30 Aug 2004 18:06:58 +1000, skaller <> wrote:

> The single ; is (usually) left associative binary sequencing
> operator of type unit that takes two expressions of
> type unit as an argument:

Only the left argument should be unit (otherwise a warning is emitted
since the result is silently ignored). The result of "e1; e2" is
(except side effects) the same as the result of e2. So something like

(); (); (); 1;;

is perfectly legal and safe. The expression:

1; 2;;

Gives a warning since the result of the first expression is ignored
implicitely. To silence the warning you write:

ignore (1); 2;;

i.e., you ignore it explicitely.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: