Andrew Reilly scripsit: > If you're going to have a *lot* of these strings (and you are, > or you wouldn't be worried about the GC angle), then you could > be better off with a "real" hash table or r/b-tree or similar > structure. Even with the assoc -> assq conversion your search > is still O(N), when it could be O(logN) or O(1).
I expect each a-list to be reasonably short (10-20 items), so constant factors dominate the search, but there may be a *lot* of a-lists. A-lists also have the advantage that you can push new "frames" on them and pop them later in constant time, which is not the case for hashtables or trees. I'm also not a big fan of libraries with memory leaks: they don't work well in programs that run for a long time, like servers. -- John Cowan [email protected] http://ccil.org/~cowan Objective consideration of contemporary phenomena compel the conclusion that optimum or inadequate performance in the trend of competitive activities exhibits no tendency to be commensurate with innate capacity, but that a considerable element of the unpredictable must invariably be taken into account. --Ecclesiastes 9:11, Orwell/Brown version _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
