English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners