Srfi-133 requires vectors of same length for vector-index-right and vector-skip-right, so we may put the same limitation for vector-fold-right.   I also don't see useful cases of passing vectors of different lengths to vector-fold-right.


On Tue, Aug 6, 2019 at 1:49 AM John Cowan <xxxxxx@ccil.org> wrote:
This point has been vague all the way back to SRFI 43.  Is it actually useful to process vectors of different lengths from the right?  I personally have never thought of doing such a thing.  If no, the spec should make it an error; but if yes, we should probably write interpretation 2 into it for definiteness.

On Tue, Aug 6, 2019 at 12:37 AM Shiro Kawai <xxxxxx@gmail.com> wrote:
When srfi-133 vector-fold is given multiple vectors, it scans each
from left to right, stops at the end of the shortest.   For vector-fold-right,
it just say "Similar to vector-fold, but it iterates right to left instead of left to right."

In multiple vector argument case with different lengths, it can be interpreted in
two ways:

  1. Take each vector's last element, then one before the last element, and so on.
  2. Let len be the length of the shortest vector.  Take each vector's (len-1)th element, 
   then (len-2)th element, and so on.

The srfi-133 reference implementation adopts 2.   For srfi-160 PR I followed it.

Does anybody think it should be 1?  Since srfi-133 document isn't explicit,
we may be able to treat the current behavior as reference implementation's bug.

If 2 is ok, I'll make it explicit in the srfi-160 document to avoid further confusion.