Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] Declaration
@ 2004-05-04 15:00 Holger Schulz
  2004-05-04 15:27 ` Jean-Christophe Filliatre
  0 siblings, 1 reply; 3+ messages in thread
From: Holger Schulz @ 2004-05-04 15:00 UTC (permalink / raw)
  To: caml-list

I've a question on declaration, I've a problem porting something from 
SML/NJ

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?

Thanks

hs

-------------------
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-07  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.44.0405041709220.30470-100000@lcmpc4.epfl.ch>
2004-05-07  9:27 ` [Caml-list] Declaration Holger Schulz
2004-05-04 15:00 Holger Schulz
2004-05-04 15:27 ` Jean-Christophe Filliatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox