Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCaml IDE (Camlp4 for code formatting)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml@d...>
Subject: Re: [Caml-list] OCaml IDE (Camlp4 for code formatting)
On Tue, 21 Jun 2005 08:18:26 -0700, Hendrik Tews  
<tews@tcs.inf.tu-dresden.de> wrote:

> Not sure if you got me right: The two phrases "let _ = 5" and "5"
> are semantically equivalent and probably compiled to the same
> code. However, they have a different representation as a camlp4
> ast. Still the question remains, why camlp4 rewrites one into the
> other.

The phrase "5" has ambituities that aren't present with the "let _ = 5" so  
it makes sense for a canonical representation to use the let form.   
Compare the following:

   let _ = 5
   let _ = 6

vs.

   5
   6

The first is valid, whereas the second causes an error trying to apply '5'.

Dave