Re: relationship to SRFI-25 Bradley Lucier 30 Sep 2015 03:42 UTC

> On Sep 29, 2015, at 12:12 PM, Jamison Hope <xxxxxx@alum.mit.edu> wrote:

Thank you for your explanation, it was very helpful.

>
> But I digress.  My original point was just that with most Scheme APIs,
> the user-level single-element accessors are functions TYPE-ref and
> TYPE-set! which take as arguments an instance of the TYPE as well as the
> location within TYPE (index or key).
>
> If I want to read out single values from several vectors, I repeatedly
> call the same function (vector-ref) passing each vector in turn.  If I
> want to read out single values from several strings, I repeatedly call
> the same function (string-ref) passing each string in turn.  If I want
> to read out single values from several SRFI-25 arrays, I repeatedly call
> the same function (array-ref) passing each.  If I want to read out
> single values from several SRFI-122 arrays, I must explicitly retrieve
> a separate getter procedure for each array.

I admit that the design of this SRFI is not optimized for the case where one wants to read single values from several arrays.  It is designed to get away from (1) the “move one word at a time” model of programming, and (2) the “store all elements of an array somewhere at the same time” model of programming.

> Again, there's nothing wrong with that in principle, but within the
> ecosystem of existing Scheme libraries, it violates the principle of
> least astonishment.

Over the years I’ve found that other people and I are astonished very different amounts by various things.  I *really* don’t like this principle.

>
> -Jamie
>
> [1] https://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html

I’ve seen it, I like it.

Brad