Comment

Comment by ggchappell

He does do a "map", although without using the function of that name:

  answers = [f(x) for x in iterable]
Also, the "zip" operation gives loops that seem to me to be unable to be decomposed into map, filter, reduce. E.g., how would you print a file with line numbers using only map, filter, reduce?

Regardless, I agree with your basic point: that thinking of loops in terms of high-level loop primitives, is a Good Thing.

parent ggchappell 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton