Arc Forumnew | comments | leaders | submitlogin
3 points by kennytilton 6125 days ago | link | parent

loop (in CL, this is) is a full-blown iteration DSL with its own tricky syntax to remember and everything, all in the name of making such code terser. The only time I use MAPCAR, CL's map, is in the rare case where I can just say:

  (mapcar 'length my-strings)
That is shorter than:

  (loop for s in my-strings collecting (length s))
loop has an initially clause, a finally clause, several kinds of ways to iterate and step, and has special keywords for different kinds of value accumulation. Like I said, it really is its own little iteration language that cuts waaay down on parentheses and otherwise makes for more terse and more efficient iteration.