caml-list - the Caml user's mailing list
 help / Atom feed
* [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05
@ 2019-06-24 21:09 Michel Levy
  2019-06-24 21:14 ` António Monteiro (anmonteiro)
  2019-06-25  5:17 ` Basile Starynkevitch
  0 siblings, 2 replies; 3+ messages in thread
From: Michel Levy @ 2019-06-24 21:09 UTC (permalink / raw)
  To: OCaml List

In "my" ocaml version, 4.05, the line A of {lit : literal; mutable scope
: int} of the type declaration

type ab_literal =
  | A of {lit : literal; mutable scope : int}
  | B of literal;;

is correct.

but in the ocaml version 4.02, the line A of {lit : literal; mutable
scope : int} is a syntax error.

Where can I find this error in the documentation and/or the 
announcement of this syntax change ?

-- 
courriel : michel.levy1948@gmail.com
mobile : 0659134253 web : http://michel.levy.imag.free.fr

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

* Re: [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05
  2019-06-24 21:09 [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05 Michel Levy
@ 2019-06-24 21:14 ` António Monteiro (anmonteiro)
  2019-06-25  5:17 ` Basile Starynkevitch
  1 sibling, 0 replies; 3+ messages in thread
From: António Monteiro (anmonteiro) @ 2019-06-24 21:14 UTC (permalink / raw)
  To: Michel Levy; +Cc: OCaml List

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

Michael,

Inline records were introduced in OCaml 4.03. Here’s a perma link for the changes entry in the compiler repo: https://github.com/ocaml/ocaml/blob/d8b6a1713b50132fc96b6cda40c8aad4ec4f8008/Changes#L3798-L3799 <https://github.com/ocaml/ocaml/blob/d8b6a1713b50132fc96b6cda40c8aad4ec4f8008/Changes#L3798-L3799>

- Antonio

> On Jun 24, 2019, at 2:09 PM, Michel Levy <michel.levy1948@gmail.com> wrote:
> 
> In "my" ocaml version, 4.05, the line A of {lit : literal; mutable scope
> : int} of the type declaration
> 
> type ab_literal =
>   | A of {lit : literal; mutable scope : int}
>   | B of literal;;
> 
> is correct.
> 
> but in the ocaml version 4.02, the line A of {lit : literal; mutable
> scope : int} is a syntax error.
> 
> Where can I find this error in the documentation and/or the 
> announcement of this syntax change ?
> 
> -- 
> courriel : michel.levy1948@gmail.com
> mobile : 0659134253 web : http://michel.levy.imag.free.fr


[-- Attachment #2: Type: text/html, Size: 1816 bytes --]

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

* Re: [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05
  2019-06-24 21:09 [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05 Michel Levy
  2019-06-24 21:14 ` António Monteiro (anmonteiro)
@ 2019-06-25  5:17 ` Basile Starynkevitch
  1 sibling, 0 replies; 3+ messages in thread
From: Basile Starynkevitch @ 2019-06-25  5:17 UTC (permalink / raw)
  To: Michel Levy, OCaml List


On 6/24/19 11:09 PM, Michel Levy wrote:
> In "my" ocaml version, 4.05, the line A of {lit : literal; mutable scope
> : int} of the type declaration
>
> type ab_literal =
>    | A of {lit : literal; mutable scope : int}
>    | B of literal;;
>
> is correct.
>
> but in the ocaml version 4.02, the line A of {lit : literal; mutable
> scope : int} is a syntax error.
>
> Where can I find this error in the documentation and/or the
> announcement of this syntax change ?


In the chapter 8. language extensions of the Ocaml reference manual: 
http://caml.inria.fr/pub/docs/manual-ocaml/extn.html

-- 
Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 21:09 [Caml-list] error in Ocaml 4.02 and not error in Ocaml 4.05 Michel Levy
2019-06-24 21:14 ` António Monteiro (anmonteiro)
2019-06-25  5:17 ` Basile Starynkevitch

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox