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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-11-21 (23:35)
From: mzukowski@y...
Subject: [Caml-list] "in" question
I've been working through Jason Hickey's introduction to Objective Caml and
don't quite get why the "in" is necessary in this construct:

# let sum i = let sum2 j = i + j in sum2 ;;
val sum : int -> int -> int = <fun>

If I leave out the "in" I get a generic "Syntax error":

# let sum i = let sum2 j = i + j ;;
Characters 31-33:
  let sum i = let sum2 j = i + j ;;
Syntax error

I'm sure it's something fundamental about scoping I'm missing.  Please
enlighten me.


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