Loading ...
Sorry, an error occurred while loading the content.

2760Re: "ocaml_beginners"::[] Execution semantics

Expand Messages
  • Seth J. Fogarty
    Nov 5, 2004
      Yup. Alright, I will buy that. Still not sure why ; is treated
      fundementally different than if..then..else.


      On Fri, 5 Nov 2004 13:52:20 +0100, Remi Vanicat <remi.vanicat@...> wrote:
      > On Wed, 3 Nov 2004 16:28:00 -0600, Seth J. Fogarty <sfogarty@...>
      > wrote:
      >
      >
      > >
      > > On Wed, 3 Nov 2004 16:03:20 -0300 (CLST), andrew cooke
      > >
      > >
      > > <andrew@...> wrote:
      > > >
      > > > Where can I find a clear description of how OCaml executes code. In
      > > > particular, I want to understand when functions with several values
      > are
      > > > evaluated - is the evaluation progressive (during Currying) or is
      > > > evaluation delayed until all arguments are present.
      > > >
      > > > For example, are the following equivalent, always?
      > > >
      > > > let example1 a b x =
      > > > let a' = f1 a in
      > > > let b' = f2 b in
      > > > f3 a' b' x
      > > >
      > > > let example2 a b =
      > > > let a' = f1 a in
      > > > let b' = f2 b in
      > > > fun x -> f3 a' b' x
      > >
      > > These two are equivalent. I have a question, however, for the list.
      > > Why does example2, when so explicitly curried as such, have a '_a when
      > > curried?
      > >
      > > # let a = example2 1 2;;
      > > val a : '_a -> int * int * '_a = <fun>
      >
      > well, when the typer compute the type of an expression, he only know
      > the type of the part of the computation. So if two function do have
      > the same type, and you apply it to sthe same argument, you have the
      > same type as a result.
      >
      >
      >
      >
      > Archives up to September 30, 2004 are also downloadable at
      > http://www.connettivo.net/cntprojects/ocaml_beginners/
      > The archives of the very official ocaml list (the seniors' one) can be
      > found at http://caml.inria.fr
      > Attachments are banned and you're asked to be polite, avoid flames etc.
      >
      >
      >
      > Yahoo! Groups Sponsor
      >
      > ADVERTISEMENT
      >
      >
      > ________________________________
      > Yahoo! Groups Links
      >
      > To visit your group on the web, go to:
      > http://groups.yahoo.com/group/ocaml_beginners/
      >
      > To unsubscribe from this group, send an email to:
      > ocaml_beginners-unsubscribe@yahoogroups.com
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      --
      Seth Fogarty sfogarty@[gmail.com|rice.edu|livejournal]
      Neep-neep at large AIM: Sorrath
      "I know there are people in this world who do not love their fellow
      human beings - and I hate people like that" --Tom Lehrer.
    • Show all 26 messages in this topic