Re: destructor
- Posted by jeremy (admin) Mar 15, 2009
- 932 views
I know that the delete() call might be superfluous in most cases but its not wrong.
Guess I should have read better
Although it will not force that change, why introduce memory management into Euphoria for just one version? I know that you have suggested it is the same as open/close, but I disagree (I may be the only one, I don't know) but the concept of opening/closing a file is everywhere and anyone understands that, even non-programmers as they open a file in Microsoft Word and a lot of times Close that file when they are done.
Creating a new map (structure in memory) and then having to close that memory structure is memory management, any way you call it and I am not sure of any other language that requires you to close a hash table or close a map (with the exception of those that require you to use memory management, that is).
For those reasons, I think we should avoid ever introducing memory management requirements into the standard library. Matt has alleviated this problem with Regular Expressions and I think we should go the extra step to alleviate it with map and stack as well. We could have just called re:free() re:close() but that doesn't make sense either, as other languages do not close a regular expression either.
My 2 cents.
Jeremy