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

RFC: table.clone #362

Merged
merged 6 commits into from
Feb 28, 2022
Merged

RFC: table.clone #362

merged 6 commits into from
Feb 28, 2022

Conversation

zeux
Copy link
Collaborator

@zeux zeux commented Feb 14, 2022

@zeux zeux added the rfc Language change proposal label Feb 14, 2022

The table can be modified after cloning; as such, a primitive like `Object.assign` could be built on top of this.

`table.clone(t)` is functionally equivalent to the following code, but it's more ergonomic (on the account of being built-in) and significantly faster:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally equivalent aside from copying protected metatables.

@zeux zeux merged commit 5e8242a into master Feb 28, 2022
@zeux zeux deleted the zeux-rfc-table-clone branch February 28, 2022 22:15
@zeux zeux mentioned this pull request Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfc Language change proposal
Development

Successfully merging this pull request may close these issues.

2 participants