Thank you.
I need to restart my interpreter from time to time :)

On Thu, Jan 6, 2011 at 12:27 AM, Christopher L Conway <[email protected]>wrote:

> "let ... and ..." does parallel binding; the binding "x = 1" isn't
> visible in "y = x". You're capturing some other definition of x, which
> is apparently a function. "let ... in let ... in" does nested binding,
> as you would expect.
>
> -Chris
>
> On Wed, Jan 5, 2011 at 11:14 AM, Kerneltrap <[email protected]> wrote:
> > Hi OCaml'ers.
> >
> > Why is this
> > let x = 1 and y = x in y;;
> > typed as
> > (int -> int) -> int = <fun>
> > ?
> > I'd expect it to have type of int and be evaluated to 1.
> >
> > How is it different to
> > let x = 1 in let y = x in y;;
> > which meets my typing expectations?
> >
> > Can first expression be rewritten somehow to give some more intuition
> > about its type?
> > Could you point to a place in the language definition which can be
> > used to deduce answer to this questions?
> >
> > Sorry if those questions are too nub for this group.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "ocaml-developer" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> [email protected]
> > For more options, visit this group at
> http://groups.google.com/group/ocaml-developer?hl=en
> > For other OCaml forums, see
> http://caml.inria.fr/resources/forums.en.html
>

-- 
You received this message because you are subscribed to the Google Groups 
"ocaml-developer" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ocaml-developer?hl=en
For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html

Reply via email to