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

arrays should have ability to push() and pop() #457

Closed
jessfraz opened this issue Sep 13, 2023 · 2 comments · Fixed by #4806
Closed

arrays should have ability to push() and pop() #457

jessfraz opened this issue Sep 13, 2023 · 2 comments · Fixed by #4806
Labels
ast Issues / features relevant to ast and parser. kcl Language and compiler features

Comments

@jessfraz
Copy link
Contributor

No description provided.

@jessfraz jessfraz added the ast Issues / features relevant to ast and parser. label Sep 13, 2023
@jessfraz jessfraz added the kcl Language and compiler features label May 22, 2024
@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Jul 9, 2024

imo.

const myArr = [1,2,3]
myArr.push(4)
log(myArr) // [1,2,3,4]

const myArr = [1,2,3]
const myOtherArr = push(myArr, 4)
log(myArr) // [1,2,3]

We don't want to allow mutation, opens too much of a can of worms, we'll loose our ability to introspect program memory.

@jtran
Copy link
Collaborator

jtran commented Nov 7, 2024

push() was merged in #4341.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Issues / features relevant to ast and parser. kcl Language and compiler features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants