Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] unused variables warning
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pixel <pixel@m...>
Subject: Re: [Caml-list] unused variables warning
Sven LUTHER <luther@dpt-info.u-strasbg.fr> writes:

> > even if the <...> is unpure, caml could warn that x' is unused. It doesn't mean
> > in any way that computing x' is unnecessary.
> > 
> > and caml should not warn for
> > 
> > let _x' = <...> in
> 
> I guess you mean just :
> 
> let _ = <...> in 

well, no. In fact i thought "_x" and "_" were the same, discarded,
non-accessible variables. I'm wrong on this.

the manual recommend not to use _xxx variables, otherwise it could have been a
way to write things like:

let _no_warning_but_meaningful_name = <...> in

but it would be another rule to learn: ``no warning for unused variables
starting with _'' (which is just what Haskell is doing).

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr