-
Notifications
You must be signed in to change notification settings - Fork 8
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
Remove immutable variants of datastructure (types)? #29
Comments
What exactly is this about? Is it still relevant? |
datastructures/gap/pairingheap.gd Line 14 in 7f651c0
|
Well, we can do that, but then we should also prevent our objects from being made immutable. (Can one do that? @stevelinton ?) Right now, one can do that, with all the bad consequences...:
So an immediate thing to do here is to require |
Looking at the code for
So we can install a method which gets triggered after the fact... but no way to prevent the operation from happening :-(. |
We had this debate many years ago over Iterators. The conclusion is that Immutable structures, while not necessarily very useful, are harmless and forbidding them creates problems elsewhere. So in this case Push and Pop would be declared requiring IsMutable. You could still, for example ask for the Size of Max of such a heap. For something like a binary search tree there is still quite a lot you can do with an immutable tree (and one could use PostMakeImmutable to balance it or turn it into an immutable sorted list or whatever). |
No description provided.
The text was updated successfully, but these errors were encountered: