On Tue, Feb 10, 2015 at 8:00 PM, Brett Nash <n...@nash.id.au> wrote: > Please don't kill _del. > > A documentation fix or guarantee on what it deletes would be nice[1] (I > recall it used to delete the most recently added item that matched). > > Del allows you to remove a callback without having to keep track of the > data pointer, which is useful, if you know the lifecycle of the datapointer > is safe. In particular since the name of the callback is a global name it > is easy to discover/keep track of, but the data pointer would require extra > access. >
The problem with this is that even if you guarantee the deletion order in the docs (that is, most recently added would be deleted first) and make it 100% obvious in that regard, it's still not safe. You can never be sure someone else hasn't added a similar callback with different data after you've added yours. As I said, this is an uncommon occurrence, but it'll become even more relevant once we start using the callback mechanism with more "global helpers" like we plan on doing on entry with string validation. Even without the global case, it's a recipe for trouble in people's code when they mismanage the order of callbacks added. We are becoming more and more protective of our developers, for example with eo pointer indirection, we wouldn't like to make sure they don't shoot themselves in the foot, and I think having this function available is a threat to that notion. Sure, it's easier not to manage that, but it's sloppy. -- Tom. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel