Re: various comments Jussi Piitulainen (17 Nov 2001 14:03 UTC)
Re: various comments Radey Shouman (17 Nov 2001 18:27 UTC)
Re: various comments Jussi Piitulainen (18 Nov 2001 14:50 UTC)
Re: various comments Per Bothner (19 Nov 2001 19:52 UTC)
Re: various comments Jussi Piitulainen (20 Nov 2001 08:14 UTC)
Re: various comments Per Bothner (20 Nov 2001 18:35 UTC)
Re: various comments Jussi Piitulainen (20 Nov 2001 19:20 UTC)
Re: various comments Per Bothner (20 Nov 2001 19:33 UTC)
Re: various comments Jussi Piitulainen (20 Nov 2001 20:14 UTC)
Re: various comments Radey Shouman (21 Nov 2001 03:31 UTC)
Re: various comments Radey Shouman (19 Nov 2001 23:26 UTC)
Re: various comments Jussi Piitulainen (20 Nov 2001 08:43 UTC)
Re: various comments Per Bothner (20 Nov 2001 19:20 UTC)
Re: various comments Jussi Piitulainen (20 Nov 2001 20:02 UTC)
Re: various comments Per Bothner (20 Nov 2001 21:08 UTC)
Re: various comments Radey Shouman (21 Nov 2001 03:58 UTC)
Re: various comments Jussi Piitulainen (21 Nov 2001 16:52 UTC)
Re: various comments Radey Shouman (21 Nov 2001 03:47 UTC)
Vectors as arrays Re: various comments Jussi Piitulainen (20 Nov 2001 18:03 UTC)
Re: Vectors as arrays Re: various comments Radey Shouman (21 Nov 2001 04:09 UTC)

Re: various comments Jussi Piitulainen 20 Nov 2001 19:20 UTC

Per Bothner writes:

> What I'm suggesting is that R5RS vectors are "simple",
> one-dimensional, zero-based arrays. If you follow CL, then yes
> vectors would be sharable, but a shared vector would no longer be a
> simple vector. You could have some functions that require "simple"
> vectors.

If I do so:

(define vec (vector "a" "b" "c"))
(define arr (share-array vec (shape 0 3) (lambda (j) (- 2 j))))

Then vec is a simple R5RS vector, but it is also the backing vector of
arr, and thus sharable and indeed shared, though it does not know it,
so to speak.

Now if I do further:

(define arr1 (share-array arr (shape 0 3) (lambda (j) (- 2 j))))

Then I get essentially the same array as vec. Its implementation might
be more expensive, though, while vec remains oblivious to all that is
going on.

Just thinking aloud...

> On the other hand, any implementation that treats vectors as a
> sub-type of arrays, should be encouraged to extend the R5RS vector
> functions to all zero-based one-dimensional arrays, shared or not.

"Encouraged" is the right language. They might even be encouraged to
notice that arr1 can be implemented simply as vec.
--
Jussi