caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] a question about syntax
@ 2018-02-14  3:31 Tim Leonard
  2018-02-14  3:41 ` Kenneth Adam Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tim Leonard @ 2018-02-14  3:31 UTC (permalink / raw)
  To: caml-list

A simple question of syntax: why does the first definition of function f cause a syntax error?
Shouldn’t the semicolon syntactically terminate the match expression?

type my_record = { field1 : bool; field2 : int };;

let f x = { field1 =   match x with _ -> true  ; field2 = 2 };; (* this fails *)

let f x = { field1 = ( match x with _ -> true ); field2 = 2 };; (* this is ok *)


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

end of thread, other threads:[~2018-02-15  1:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14  3:31 [Caml-list] a question about syntax Tim Leonard
2018-02-14  3:41 ` Kenneth Adam Miller
2018-02-14  4:12 ` Yawar Amin
2018-02-14  4:32   ` Tim Leonard
2018-02-14 18:50 ` Oliver Bandel
2018-02-14 23:02   ` Chet Murthy
2018-02-14 23:40     ` Ian Zimmerman
2018-02-15  0:17       ` Evgeny Roubinchtein
2018-02-15  1:17       ` Chet Murthy

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).