The suggestion of @vector-fold-left is consistent with R6RS, which has fold-left, taking the same order in the kons procedure as @vector-fold.

I agree that it's too late to fix srfi-133, and srfi-160 should follow srfi-133.  But I'd say it will haunt us... since the order discrepancy is one layer indirect, it can be very confusing.

On Sun, Jul 28, 2019 at 5:47 PM John Cowan <xxxxxx@ccil.org> wrote:


On Wed, Jul 24, 2019 at 8:03 AM Shiro Kawai <xxxxxx@gmail.com> wrote:

The order of kons in vector-fold / @vector-fold is the same as R6RS fold-left.
In a retrospect, vector-fold-left and @vector-fold-left would've been a better choice.

SRFI 1 established the precedent that we don't use "-left" as part of fold, and SRFI 13 extended that to trim and pad.  Left is a natural default for folding in an eager languages, as right is a natural default in a lazy language.
 
Now that srfi-133 is (scheme vector), so it would be difficult to change.  It isn't desirable
that srfi-160 and srfi-133 deviate.  I'm not sure how to solve this.   At least, if there
would be another chance, I like it to be adjusted for the consistency.

It was already beyond fixing when 133 was first created, because it would have produced a subtle incompatibility between 43 and 133.  The other incompatibilities involved the *number* of arguments passed to procedure arguments and would have failed noisily, whereas a problem with the *order* of arguments would often be silent.  To make things worse, many fold examples are commutative, in which case it doesn't matter.

I think we have to live with the list and string SRFIs (Olin Shivers's group) being incompatible in order with the vector SRFIs (Taylor Campbell's group), and just maintain compatibility within each group.

I've just sent an email to Taylor to ask if he remembers why the discrepancy.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Almost all theorems are true, but almost all proofs have bugs.
        --Paul Pedersen