| Ulrich Hobelmann 2005-11-03, 7:01 pm |
| David Van Horn wrote:
> Ulrich Hobelmann wrote:
>
> This example is exactly where a macro gives you nothing compared to its
> procedural counterpart. Well, except that I have to remember another
Efficiency. To make the Scheme version avoid a dynamic function call
FOR-EACH needs to be recognized by the compiler. DOLIST is just a macro
that expands to label-and-goto code.
> binder besides the universal one, lambda. I have to remember the
> evaluation rules for this special form rather than the universal one for
> application. There's no abstraction or any other benefit offered by
> dolist over for-each. Lastly, dolist has been relegated to second class
> status whereas for-each is a first-class citizen.
That's right, but DOLIST's syntax is so easy that I gladly pay the
price. FOR-EACH is too verbose and distracts from the essentials, IMHO.
> Maybe there are other features of dolist that separate it from for-each,
> but for this example the procedure clearly wins in my opinion.
>
> Could you say *why* you much prefer one over the other?
I find it more readable, more writeable, and it's probably faster.
--
The road to hell is paved with good intentions.
|