caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Strange syntax error
@ 2005-01-23 21:11 Richard Jones
  2005-01-23 21:44 ` [Caml-list] " Nicolas Cannasse
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard Jones @ 2005-01-23 21:11 UTC (permalink / raw)
  To: caml-list

The following compiles fine:

  type t = { keyword : string; cost : float option; }
  
  let f =
    function
      | { keyword = keyword } when keyword.[0] = '-' -> keyword
      | { keyword = keyword; cost = None } -> keyword
      | _ -> failwith "whatever"

But this, which surely is equivalent, fails with a syntax error at the
second '|' character:

  type t = { keyword : string; cost : float option; }
  
  let f =
    function
      | { keyword = keyword } when keyword.[0] = '-' (* -> keyword *)
      | { keyword = keyword; cost = None } -> keyword
      | _ -> failwith "whatever"

OCaml 3.08.1.

Is this a parsing bug?

Rich.

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-23 23:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-23 21:11 Strange syntax error Richard Jones
2005-01-23 21:44 ` [Caml-list] " Nicolas Cannasse
2005-01-23 21:49 ` Jon Harrop
2005-01-23 22:23 ` Kurt Welgehausen
2005-01-23 23:12   ` Richard Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).