Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.

Thanks,

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