Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Optimize ref.contents to something more user friendly #115

@Huxpro

Description

@Huxpro

Personally, I understood that contents is the mutable field name of the record returned by ref constructor in the OCaml std libraries, however:

  1. it's quite foreign to JavaScript community.
  2. I've also heard people complain that "contents" being a plural could be a significant source of typo for non-native speakers.

I'm not asking to bring a syntax sugar back (though I'm happy to have * ref...). A workaround could be as simple as replacing that name to something better. current, value, deref are all good candidates.

Alternatively, to not break existing .contents code, adding a helper function e.g. deref() to the Pervasive may be sufficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions