caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <yallop@gmail.com>
To: Yann Hamdaoui <yann.hamdaoui@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Inlined records don't work in toplevel
Date: Thu, 14 Apr 2016 08:14:28 +0100	[thread overview]
Message-ID: <CAAxsn=GtVdZvc7JwvxiwSUgFBT2gUSGOgSvrDev4AqKFasv2ow@mail.gmail.com> (raw)
In-Reply-To: <570EBA68.8010000@gmail.com>

Dear Yann,

On 13 April 2016 at 22:30, Yann Hamdaoui <yann.hamdaoui@gmail.com> wrote:
> 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)

The error is coming from Camlp4.  Perhaps you have an .ocamlinit file
that loads Camlp4 into the toplevel.  It appears that Camlp4's parser,
at least in the version you have installed, doesn't support the
inlined record syntax.

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

Running ocaml with a filename as argument doesn't run .ocamlinit
files, so Camlp4 is not loaded and the standard OCaml parser is used
instead.

Kind regards,

Jeremy.

  parent reply	other threads:[~2016-04-14  7:14 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
2016-04-14  7:14 ` Jeremy Yallop [this message]
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='CAAxsn=GtVdZvc7JwvxiwSUgFBT2gUSGOgSvrDev4AqKFasv2ow@mail.gmail.com' \
    --to=yallop@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=yann.hamdaoui@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).