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

AW: Several comments

This page is part of the web mail archives of SRFI 43 from before July 7th, 2015. The new archives for SRFI 43 contain all messages, not just those from before July 7th, 2015.

> > 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