You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7306 Reporter:@bobzhang Status: closed (set by @mshinwell on 2016-12-12T16:35:21Z) Resolution: won't fix Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
in ocaml, we can declare a record with mutable field
type t = {mutable x : int ; y : int}
but you can not say
let v= {mutable x = 3 ; y = 32}
ideally, we support mutable in record construction (and pattern match maybe), and give a warning if mutable is not provided,
the use case is for safety, in general, we want to share some immutable records, however, it is not explicit whether record is mutable or not, with this feature we can easily tell the record is immutable or not
The text was updated successfully, but these errors were encountered:
I don't see why this is necessary and think it unlikely to be accepted. Presumably the issue relates to determining whether such record constructions are mutable inside the compiler---but they are already marked as mutable. They have to be (at least when using Flambda) otherwise wrong optimisation might result.
Original bug ID: 7306
Reporter: @bobzhang
Status: closed (set by @mshinwell on 2016-12-12T16:35:21Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
in ocaml, we can declare a record with mutable field
but you can not say
ideally, we support mutable in record construction (and pattern match maybe), and give a warning if mutable is not provided,
the use case is for safety, in general, we want to share some immutable records, however, it is not explicit whether record is mutable or not, with this feature we can easily tell the record is immutable or not
The text was updated successfully, but these errors were encountered: