katcipis / luanotify

Luanotify is a Lua package providing tools for implementing observer programming pattern
http://wiki.github.com/katcipis/luanotify
GNU Lesser General Public License v3.0
20 stars 4 forks source link

OrderedSet implementation #11

Closed katcipis closed 14 years ago

katcipis commented 14 years ago

Instead of building two implementation (Stack and Queue), maybe it is better to do one implementation, a ordered set.

The advantages are:

With a Set behaviour the Signal does not to care if there is already a handler or emit function registered, the Set simply discards an element if you try to insert it again, all this done with O(1), using the idea given on the list of two tables (table[pos] = value, table[value] = pos).

It would be a mix of List implementation from PIL book with the idea given on the list with changes to be better suited to our application.

katcipis commented 14 years ago

adding OrderedSet interface -closed by a24265aa20544e86b5303dd494bd2dc5d278f46e -closed by a24265aa20544e86b5303dd494bd2dc5d278f46e -closed by a24265aa20544e86b5303dd494bd2dc5d278f46e