From: Yann Hamdaoui <yann.hamdaoui@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] Inlined records don't work in toplevel
Date: Wed, 13 Apr 2016 23:30:16 +0200 [thread overview]
Message-ID: <570EBA68.8010000@gmail.com> (raw)
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
next reply other threads:[~2016-04-13 21:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 21:30 Yann Hamdaoui [this message]
2016-04-14 6:59 ` Mr. Herr
2016-04-14 7:14 ` Jeremy Yallop
2016-04-14 7:49 ` Yann Hamdaoui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570EBA68.8010000@gmail.com \
--to=yann.hamdaoui@gmail.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox