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] Declaration
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-04 (15:02)
From: Holger Schulz <schulz@m...>
Subject: [Caml-list] Declaration
I've a question on declaration, I've a problem porting something from 

In SML/Nj i'd declare

val x= "fgdsgh";

and than

let val x = 2
      val y = x+2
in y end;

The first declaration would overwrite the x which will be used in the 
declaration of y. I've look in the Ocaml manual but I only found 
examples with simultanous declaration like

let x ="dhshdjsa";;

let x =2 and y= x+2 in y;;

which of course delivers a type error, coss x isn't overwritten here. 
How the syntax for non-simultanous declaration?



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