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

Should we have pop, push and friends? #66

Open
Tokazama opened this issue Aug 30, 2020 · 2 comments
Open

Should we have pop, push and friends? #66

Tokazama opened this issue Aug 30, 2020 · 2 comments

Comments

@Tokazama
Copy link
Member

StaticArrays has all of these non-mutating versions of typically mutating methods implemented, which might be a good fit for this package since we have setindex. It would be nice if these were available outside of a dependency on StaticArrays and part of the general array interface.

@chriselrod
Copy link
Collaborator

Out of curiosity, what do you think of BangBang.jl?

It maybe nice to try and support a more uniform interface, e.g. x = push!!(x, 2).
Of course, the methods changing the data structure's length won't be type stable for anything typed by size.

I hope @tkf doesn't mind getting pinged here, in case he'd like to give feedback or suggestions on a general interface.
Also because I wonder if this would be somewhat of a fracturing of these sorts of methods between ArrayInterface and BangBang.

@Tokazama
Copy link
Member Author

Tokazama commented Sep 1, 2020

Ive always liked the syntax of BangBang but have never ended up using it. It might become more convenient as Julia gets more immutable collections though.

I also don't see what other possible meaning that syntax could reasoanably have, so it seems like a pretty safe thing to commit to if we moved forward with it.

chriselrod added a commit that referenced this issue Sep 14, 2020
Non-mutating versions of pop, popfirst, etc. (#66)
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

2 participants