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

change name from Tuple to ImmutableArray and Record to ImmutableObject #217

Closed
Fenzland opened this issue Jan 30, 2021 · 4 comments
Closed

Comments

@Fenzland
Copy link

In other languages, like Python, tuples or records can contains all types of values. But in this proposal, what you want implement are not the same thing, but something like deeply immutable arrays and deeply immutable objects. Using names 'Tuple' and 'Record' cannot adequately represent the meaning of deeply immutable, and will confuse people with experiences with other languages. We also need something like tuples in other languages, can contains object but immutable itself, I really wish this proposal not kill the possible of that.

@open-novel
Copy link

There are some major differences between Tuple and Array besides whether they are Immutable or not.
I think that using the word "Immutable" is confusing.

@CrazyPython
Copy link

They also don't have an identity.

@spartanatreyu
Copy link

There are some major differences between Tuple and Array besides whether they are Immutable or not.

As of now, I think most developers are just going to think of them as immutable arrays, with equality/reference-by-value being a nice secondary improvement.

As to naming confusion, I think the current names are going to bring some confusion anyway. Record in the Typescript ecosystem springs to mind. I could easily see Typescript renaming (or at least aliasing) their Record utility type to avoid confusion if Tuple and Record are the final names for this proposal.

I don't know if the final names should be Tuple and Record or not, but ImmutableArray and ImmutableObject don't seem like the worst ideas. After all, we already have the various TypedArrays hightlighting their similarity to Arrays (even though there are some major differences with them too).

@rricard
Copy link
Member

rricard commented Feb 25, 2021

This issue is a duplicate of #82. We are also aware of other instances of Record & Tuple out there, notably in TypeScript, WebIDL (#116) and the ECMA262 spec (#96), however please keep in mind ImmutableObject is not an option as Records are not Objects. For further naming disussion, I invite you to discuss in #82.

@rricard rricard closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants