From: "Mr. Herr" <misterherr@freenet.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Inlined records don't work in toplevel
Date: Thu, 14 Apr 2016 08:59:21 +0200 [thread overview]
Message-ID: <570F3FC9.3080001@freenet.de> (raw)
In-Reply-To: <570EBA68.8010000@gmail.com>
On 13.04.2016 23:30, Yann Hamdaoui wrote:
> 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 ?
>
most recent version is beta2 AFAIK, this case is okay - protocol:
strobel@suse132-intel:~> ocamli
OCaml version 4.03.0+beta2
# type t = A of int;;
type t = A of int
# type t' = B of {x : int};;
type t' = B of { x : int; }
#
/Str.
next prev parent reply other threads:[~2016-04-14 7:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 21:30 Yann Hamdaoui
2016-04-14 6:59 ` Mr. Herr [this message]
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=570F3FC9.3080001@freenet.de \
--to=misterherr@freenet.de \
--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