Two different closed object syntaxes


#1

I’m exploring the following two closed object syntaxes:

Syntax #1

type personA = {. name: string};

let a: personA = {as _; pub name = "Hello"};

let aName = a#name;

Syntax #2

type personB = {. "name": string};

let b: personB = {"name": "Hello"};

let bName = b##name;

The types are similar, but their usage is quite different.

When might you use each of these types?

Thanks!


#2

Hi, this doc page explains syntax #1 and includes a link to the explanation for syntax #2: https://reasonml.github.io/docs/en/object


#3

Thanks @yawaramin