[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loop vs Do



The issue is not that DO is terrible, but that DO only implements a small
subset of what LOOP does.  Specifically, DO only allows you to step variables
in parallel (sometimes you need the new value of one variable to depend on another,
and sometimes you don't), does not come with pre-packaged iterations through
various data structures, does not come with pre-packaged ways to create
return values in various ways, and does not allow you to control the order
of operations (variable-stepping vs end-test).

An example that works naturally in DO will not tell you anything about why
you need LOOP.  The problem is that writing many more complex iterations
with DO requires filling it up with SETQs and RETURNs (even GOs on rare
occasions).