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

New trait for collections that change sizes (issue #22) #60

Merged
merged 3 commits into from
Aug 12, 2020
Merged

New trait for collections that change sizes (issue #22) #60

merged 3 commits into from
Aug 12, 2020

Conversation

Tokazama
Copy link
Member

@Tokazama Tokazama commented Aug 11, 2020

Even if you have a mutable structure it might not be able to change sizes. With this PR if is_dynamic returns true then the following operations should work for a given collection:

  • push!
  • pushfirst!
  • pop!
  • popfirst!
  • insert!
  • deleteat!

I also updated the README with these methods and can bump the version number if this all sounds good.

@ChrisRackauckas
Copy link
Member

is_dynamic_sized?

@chriselrod
Copy link
Collaborator

I'm a little concerned about ambiguity of dynamic referring to changing size vs size-unknown-at-compile time.

@Tokazama
Copy link
Member Author

I'm a little concerned about ambiguity of dynamic referring to changing size vs size-unknown-at-compile time.

I did bring up having a distinction between static, fixed, and dynamic sizes in the referenced issue but I didn't include these because something like UnitRange couldn't have a dynamic size even if it's not known at compile time. I'd be happy to include them if it's seen as a necessary inclusion.

is_dynamic_sized ?

Although that's more specific I'm not sure what else would be "dynamic", so I prefer the is_dynamic syntax. However, I'd be open to changing if people feel strongly.

@ChrisRackauckas
Copy link
Member

can_change_size

@Tokazama
Copy link
Member Author

can_change_size seems like it would be much more consistent with the other methods here. I'll change it.

Also update docstring to reflect this change
@ChrisRackauckas ChrisRackauckas merged commit 4a959b1 into JuliaArrays:master Aug 12, 2020
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

Successfully merging this pull request may close these issues.

3 participants