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

9689Re: "ocaml_beginners"::[] Writing to many files

Expand Messages
  • Johann Spies
    Apr 23, 2008
      On Tue, Apr 22, 2008 at 08:25:10AM -0500, William D. Neumann wrote:
      > On Tue, 22 Apr 2008 11:39:51 +0200, Johann Spies wrote
      >
      > > I have adapted your code because I want to use two different output
      > > files. My code produces an error which I do not understand:
      > >
      > > Characters 226-250:
      > > This pattern matches values of type 'a option * 'b option * 'c option
      > > but is here used to match values of type 'd option * 'e option
      > >
      > > The code:
      > >
      > > let last_date = ref None
      > > and last_auth = ref None
      > > and last_acc = ref None
      > >
      > > let outputfile date =
      > > match !last_date,!last_auth, !last_acc with
      > > | Some d, Some oc when d = date, Some ot -> oc,ot
      > > | Some d, None when d = date, None ->
      >
      > The problem is in these last two lines. The when clause has to come after
      > the entire pattern, not in the middle of it. change those two lines to the
      > following and it works:
      >
      > | Some d, Some oc , Some ot when d = date -> oc,ot
      > | Some d, None, None when d = date ->
      >
      > See chapter 6 of the manual for more detail.
      >

      Thanks.

      Johann
      --
      Johann Spies Telefoon: 021-808 4036
      Informasietegnologie, Universiteit van Stellenbosch

      "That Christ may dwell in your hearts by faith; that
      ye, being rooted and grounded in love, May be able to
      comprehend with all saints what is the breadth, and
      length, and depth, and height; And to know the love of
      Christ, which passeth knowledge, that ye might be
      filled with all the fulness of God."
      Ephesians 3:17-19
    • Show all 17 messages in this topic