AW: Several comments Michael Burschik 23 Apr 2003 09:05 UTC

> > Given a not too inefficient implementation of vector-reverse, which
> > should be possible, the whole issue of left/right iteration
> > would seem rather pointless.
> Actually for vectors having the different left/right iterators is more
> important because a reverse is entirely unnecessary. It's just a
> decrementing integer loop instaed of an incrementing one.
> There's a big efficiency gain here.

In general, you are right. However, a really efficient implementation of
vector-reverse might simply toggle a left/right flag in the vector itself.
Given copy-on-write, one would not even have to copy the vector in many

Efficiency, however, is a two-edged knife. Some things can be handled
efficiently by the machine, other things can be efficiently handled by
the human brain. Unfortunately, the intersection is not very large. And
my brain, at least, is more comfortable with

(vector-map f (vector-reverse v))

than with

(vector-map-right f v)

Naturally, your mileage may vary.


Michael Burschik