Whenever I need to iterate through the keys and values of some table g, my brain seems to naturally reach for (each (k v) g
... do stuff with k and v ...)
Currently there's ontable to do that, and each called with a table iterates through the values. Code using ontable does have two less parentheses (ontable k v g
... do stuff with k and v ...)
though that seems to be offset for me by having one less syllable in "each".I don't know how often each is currently called with tables in the news code, but I thought I'd throw it out there as I seem to need to iterate through keys and values a lot and rarely (never?) needed to iterate just through the values. |