"Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> writes: > Set: Items are iterated over in the order that they are added. Adding an > item that compares equal to one that is already in the set does not > replace the item already in the set, and does not change the iteration > order. Removing an item, then re-adding it moves the item to the end of > the iteration order. Well, this could be satisfied by an append_new operation on lists, right (thinking of Common Lisps #'cl:pushnew)? Complexity not that great, of course, but I've written code like: if a not in l: l.append(a) and not suffered that badly for it before now... > Dict: Keys are iterated over in the order that they are added. Setting a > value using a key that compares equal to one already in the dict > replaces the value, but not the key, and does not change the iteration > order. Removing a key (and value) then re-adding it moves the key to the > end of the iteration order. And these are what CL types call association lists, in effect. Cheers, mwh -- #ifndef P_tmpdir printf( "Go buy a better computer" ); exit( ETHESKYISFALLINGANDIWANTMYMAMA ); -- Dimitri Maziuk on writing secure code, asr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4