Re: mutable-array setter vs SRFI-17 Bradley Lucier 29 Sep 2015 06:06 UTC

On 09/28/2015 07:03 PM, Jamison Hope wrote:
> On Sep 28, 2015, at 4:44 PM, Bradley Lucier <xxxxxx@math.purdue.edu> wrote:
>>
>> I think the order of arguments to vector-set! was an error that doesn't become clear until you use a multi-index instead of a a simple index as argument.
>
> I agree with Per about the argument order, it matches the argument order
> for set-car!, set-cdr!, string-set!, vector-set!, and the various other
> setters in (at least) SRFIs 4, 13, 25, 66, 69, 74, and 101 and RnRS (for
> all n, AFAICT).
>
> It also matches the order in which arguments appear for array-setting
> expressions in other languages:
>
> (setf (aref array x y z) newvalue) ;; Common Lisp

I don't see this as an example of your argument.  My understanding is
that setf is a macro that examines the "form" that is the first of its
arguments and generates code for a specific setter for each "getter" form

> array[x][y][z] = newvalue;         /* C, C++, Java, ... */
> Array(x,y,z) = newvalue;           # Matlab
> ARRAY[$x]=$newvalue;               # Bash
> $array[$x] = $newvalue;            # Perl
>
> On the other hand, SRFI-47 agrees with you and the world didn't explode.

:-)  I like arguments like this.

Brad