"Flexvector" vs adding "capacity" to "vector" Erik Dominikus (12 Oct 2020 14:39 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Marc Nieper-Wißkirchen (12 Oct 2020 14:47 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" John Cowan (13 Oct 2020 02:54 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Marc Nieper-Wißkirchen (13 Oct 2020 05:45 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" John Cowan (13 Oct 2020 18:59 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Shiro Kawai (13 Oct 2020 19:12 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Erik Dominikus (01 Nov 2020 18:46 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Marc Nieper-Wißkirchen (13 Oct 2020 19:26 UTC)
Re: "Flexvector" vs adding "capacity" to "vector" Shiro Kawai (13 Oct 2020 07:29 UTC)

Re: "Flexvector" vs adding "capacity" to "vector" Marc Nieper-Wißkirchen 12 Oct 2020 14:47 UTC

Am Mo., 12. Okt. 2020 um 16:39 Uhr schrieb Erik Dominikus
<xxxxxx@gmail.com>:
>
> Dear SRFI-214 subscribers,

Thanks for sharing your thoughts with us.

> Its advantages compared to flexvectors:
>
> - It subsumes Scheme vectors, so it is backward-compatible with
> existing Scheme code: just set siz = cap = the length of the vector.
> - It does not define a new type, so it does not raise difficult
> questions about subtyping, nomenclature, name-prefixing,
> comparison/ordering, etc.

These are huge advantages.

> Its disadvantages compared to flexvectors:
>
> - It requires changing the layer below Scheme, although the change
> should be small if the underlying layer does not assume that vector
> contents cannot move.
> - Perhaps not everyone can afford that change.

This can be an obstacle for many Schemes. When you have an ordinary
non-resizable vector, a vector can be a (tagged) pointer to a struct
with a flexible array member roughly of the form

struct
{
  size_t len;
  object [];
};

In your approach, there is one more pointer indirection, making all
vector code slower.