Applying operations to the elements of a hashtable currently requires the creation of a list of keys. If one is only interested in operations with side-effects on the elements (e.g., changing the entry, creating dynamic rules, printing) the construction of the list is wasteful, especially when it concerns large tables. A fold operation on the keys/values of a table implemented using iteration rather than recursion, allows one to avoid list construction, while still providing the possibility of building up a composite result from the entries.

Submitted on 13 September 2006 at 21:37

Log in to post comments