Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Warnings in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ching-Tsun Chou <ctchou@m...>
Subject: Re: Warnings in ocaml

   I copied from SML and defined a procedure "ignore":

     let ignore k =
       let _ = k in ()

   so now I would write:

     ignore (f x y); ...

How about instead of writing:

        (f x y) ; (g z w) ; ...

write:

        let _ = (f x y) in
        let _ = (g z w) in
        ...

In fact, I found it scarcely necessary to use ";" these days even when
I was doing imperative programming.

Cheers,
- Ching Tsun

=====================================================================
  Ching-Tsun Chou                   E-mail: ctchou@mipos2.intel.com  
  Intel Corporation                 Tel: (408) 765-5468              
  3600 Juliette Lane, SC12-401      Fax: (408) 653-7933              
  Santa Clara, CA 95052, U.S.A.     Sec: (408) 653-8849              
=====================================================================