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

Re: "ocaml_beginners"::[] functional record update => problems = Bug ?!

Expand Messages
  • Michael Wohlwend
    ... this works for me: let add_to_ncl_2 rel nch = { rel with ncl = (nch :: rel.ncl) } In the initialisation { expr with field = expr { ; field = expr } }
    Message 1 of 3 , Feb 28 2:14 PM
    • 0 Attachment
      On Tuesday 28 February 2006 22:29, Oliver Bandel wrote:
      > Hello,
      >
      > let add_to_ncl_2 rel nch = { rel with ncl = (nch :: ncl) }
      >
      > (* =============================================================== *)

      this works for me:
      let add_to_ncl_2 rel nch = { rel with ncl = (nch :: rel.ncl) }

      In the initialisation
      { expr with field = expr { ; field = expr } }
      the first expr is a record, the other expr are arbitrary expressions, which
      means you must use expr.field to access a record field. That's how I read to
      docu...

      cheers,
      Michael
    Your message has been successfully submitted and would be delivered to recipients shortly.