4 ms·
I see a lot of people using loop in the wild, but personally I took to heart Paul Graham's advice from ANSI Common Lisp to generally avoid it because of the exa
by dwringer 4y ago
I see a lot of people using loop in the wild, but personally I took to heart Paul Graham's advice from ANSI Common Lisp to generally avoid it because of the exact reason you've suggested, it's complicated and honestly not very "Lispy". I just use do instead, and I'll admit it's not the most streamlined compared to other languages but it does the job in a simple and predictable way.
- kaveh808 4y agoI only use loop if I'm iterating over multiple sequences or doing something tricky. Otherwise I use dolist, dotimes, map, mapcar. But it's nice to know loop is there...
- dreamcompiler 4y agoSame here. Loop is handy for iterating over hash-tables and collecting. Beyond that I prefer tail recursion, map, reduce, some/every, and the do forms.