caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Inlined records don't work in toplevel
@ 2016-04-13 21:30 Yann Hamdaoui
  2016-04-14  6:59 ` Mr. Herr
  2016-04-14  7:14 ` Jeremy Yallop
  0 siblings, 2 replies; 4+ messages in thread
From: Yann Hamdaoui @ 2016-04-13 21:30 UTC (permalink / raw)
  To: caml-list

Dear list,

I tried to test inlined records for type constructors with
4.03.0+trunk+flambda in the toplevel and the syntax seems not to be
recognized :

%ocaml
OCaml version 4.03.0+dev18-2016-04-01
[....]
# type t = A of int;;
type t = A of int
# type t' = B of {x : int};;
Error:Parse error: [str_item] or ";;" expected (in [top_phrase])
(the A is underlined)

However if I put the code in a file test.ml

type t = A of {x : int}
let a = A {x=5}
let () = match a with A r -> print_int r.x

and run

%ocaml test.ml
5

everything goes fine. Am I missing something ?

-- 
Y.H

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

end of thread, other threads:[~2016-04-14  7:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 21:30 [Caml-list] Inlined records don't work in toplevel Yann Hamdaoui
2016-04-14  6:59 ` Mr. Herr
2016-04-14  7:14 ` Jeremy Yallop
2016-04-14  7:49   ` Yann Hamdaoui

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