Version franaise
Home About Download Resources Contact us
Browse thread
Value shadowing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Etchemaïté <petchema@c...>
Subject: Re: [Caml-list] Value shadowing (tangent)
Le Sun, 17 Aug 2008 09:07:10 +0100, "David Allsopp" <dra-news@metastack.com> a écrit :

> > On the other hand, the 'let' scope will end exactly at the same place as
> > the englobing scope. Since you can't close one without closing the
> > other, 
> 
> That's not true. 
> 
> let x =
>   let y =
>     let z = ()
>     in
>       ()
>   in
>     () (* z no longer in scope *)
> and a = ()
> in
>   (* y and z no longer in scope *)

Now you're using lets within the _definition_ part of previous lets,
not within their scope. Even in the other style, that code would
require indentation like this:

let x =
  let y =
    let z = () in
    () in
  ()
and
  a = () in
(* ... *)

> Personally, I prefer the latter but
> that's a matter of style/taste, not sense.

I'm saying that "standard" indentation style makes sense, not that your
indentation style doesn't. Beware of xor-mode thinking :)

Best regards,
Pierre.