Re: relationship to SRFI-25 Bradley Lucier 28 Sep 2015 21:04 UTC

On 09/27/2015 01:33 AM, Per Bothner wrote:
> I think this has been mentioned before: the name specialized-array-share!
> should not end in a '!'.

Perhaps, I don't remember the remark.

Let me say what issue I was trying to address by adding "!" and you can
offer some advice.

I've generally thought that the bang "!" in set-cdr!, vector-set!, etc.,
was to alert the reader that something strange or nonlocal could happen.

In our case, if we have

(define domain (interval '#(0 0) '#(100 100)))
(define a (array->specialized-array (array domain list)))

for which

((getter a) 0 0) => (0 0)

and then

(define b (specialized-array-share! a (interval '#(0) '#(100)) (lambda
(i) (values i j))))

then calling

((setter b) #t 0)

will change subsequent values of

((getter a) 0 0) => #t

So after calling specialized-array-share!, code text that doesn't
involve a affects the result of code that *does* involve a.

That's why I put the bang "!".

I'd prefer there to be some syntactic way to indicate that using
specialized-array-share! could trip you up.

Given this understanding, can you offer some advice about naming here?