by tsurantino · 11y ago · 0 comments
I think animating the transformation from a normal loop to a list comprehension is a great way to show how the syntax translates between the two forms. Very awesome and comprehensive post.
However, from a practical point of view I think it is great introduction for procedural programmers to begin using list comprehensions.
arrays/lists (like maps/hashes, though with a more narrow restriction on the indices) are (or at least are isomorphic to) sets of pairs of (index, element).
They carry information about order which does not exist in multisets/bags.