This project is read-only.

Should clear actually delete the collection?

Jun 27, 2007 at 2:18 AM
Currently we have tasks like dict-clear and list-clear. These remove all items from the collection. After these tasks are run, should the collections dict::exists() and list::exists return true or false? If they should still return true, should we then have dict-delete and list-delete or are they unnecessary? Thoughts?
Jul 5, 2007 at 4:52 AM
nAnt itself currently doesn't unassign variables or "properties". Once a property is set, propery::exists will always return true. In addition, I feel that a build script that is concerned about these extra empty collections taking up resources might already be too unweildy.

I think that "dict::exists()" should return true if it has been created in the current build, regardless of it being emptied and we need either "dict::hasitems()" or "dict::isempty()" (or both). My question for you is should "dict::is_empty()" return true or false if the dict does not exist? I personally would, rather than test for the existance of a collection, test for the existance of items in a collection.
Jul 5, 2007 at 1:44 PM
That sounds reasonable. I will add a work item for dict::is-empty and list::is-empty. They should both return true if the collection doesn't exist.