Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support record updates #23

Closed
leostera opened this issue Oct 29, 2020 · 0 comments
Closed

Support record updates #23

leostera opened this issue Oct 29, 2020 · 0 comments
Labels
compiler Related to the OCaml to Erlang compiler enhancement New feature or request

Comments

@leostera
Copy link
Owner

leostera commented Oct 29, 2020

The following OCaml currently does not compile:

type t = { b: int; c: bool }

let f () =
  let a = { b=1; c=true } in
  { a with b=2 }

Whereas it should compile to:

f() ->
  A = #{ b => 1, c => true },
  A#{ b := 2 }.

To get this done, we need to look into the extended_expression of the Texp_record value and if it is not None, then use that with the already existing Expr.map_update function from the Ast helpers.

@leostera leostera added enhancement New feature or request compiler Related to the OCaml to Erlang compiler labels Oct 29, 2020
@leostera leostera added this to the v0.1 milestone Oct 29, 2020
@leostera leostera mentioned this issue Oct 29, 2020
61 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Related to the OCaml to Erlang compiler enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant