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

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

Expand Messages
  • Remi Vanicat
    Nov 5, 2004
    • 0 Attachment
      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

      The awnser of Issac is correct, but I wabt to insist one one thing :
      the ocaml semantic is the more natural one. In the first exemple, you
      have define a function that wait for three argument before making any
      computation, in the second exemple, you've define a function that wait
      for two argument, then do part of the computation then do another
      computation. What will happen is what you read.
    • Show all 26 messages in this topic