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

7026Re: "ocaml_beginners"::[] Type mismatch but why?

Expand Messages
  • Robert Roessler
    Jan 4, 2007
    • 0 Attachment
      Jonathan Roewen wrote:
      > ...
      > I've never quite fully understood labels. Perhaps the fully applied
      > function doesn't need labels thing doesn't apply to optional arguments
      > -- which seems a shame.
      >
      > Anyways, the workaround is to label the optional argument. And to
      > eliminate the warning, either change the order so it's not at the end,
      > or add a dummy argument to the end (unit).

      Just to emphasize this point, from "4.1.1 Optional arguments" of the
      OCaml manual we have

      "A function taking some optional arguments must also take at least one
      non-labeled argument. This is because the criterion for deciding
      whether an optional has been omitted is the application on a
      non-labeled argument appearing after this optional argument in the
      function type."

      While this may not directly address your "fully applied" issue, it
      definitely covers the ordering thing.

      Robert Roessler
      robertr@...
      http://www.rftp.com
    • Show all 5 messages in this topic