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

Mutable vector should be growable. #28

Open
spdegabrielle opened this issue Jul 18, 2019 · 4 comments
Open

Mutable vector should be growable. #28

spdegabrielle opened this issue Jul 18, 2019 · 4 comments

Comments

@spdegabrielle
Copy link
Sponsor Member

No description provided.

@spdegabrielle spdegabrielle changed the title [sorawee](/sorawee) Mutable vector should be growable. Mutable vector should be growable. Jul 18, 2019
@spdegabrielle
Copy link
Sponsor Member Author

requested by @sorawee

@sorawee
Copy link
Contributor

sorawee commented Jul 18, 2019

There are two parts for this:

  1. I can't think of a reason why there would be an overhead in growable vector, but if there's one, we might want to keep fixed-size vector for those who want performance. However, growable vector should be provided as the default, with a sensible name that is not gvector.
  2. But if not, we could also just provide growable vector alone.

@rmculpepper
Copy link

I disagree. There are lots of ways that code can break if a mutable vector unexpected changes size (presumably growable vectors are also shrinkable vectors!). Such bugs and potential bugs were a major part of the reason that Racket made pairs immutable.

IMO, resizable vectors should be a conveniently-available but distinct data type.

@sorawee
Copy link
Contributor

sorawee commented Jul 19, 2019

OK, I'm sold on this. But we should pick a better name than gvector.

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

3 participants