Re: Nomenclature Marc Nieper-Wißkirchen 08 Oct 2020 13:01 UTC

Am Do., 8. Okt. 2020 um 14:50 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:
>
> > If you think of Emacs buffers, yes.
>
> Fair enough.
>
> > The problem with "vector" is that the data type described by SRFI 214
> > behaves more like a list than a vector. It's not "conceptionally the
> > same as a vector"! So while one may not initially know what a "buffer"
> > is, at least it does not lead to false connotations when one looks at
> > the existing zoo of Scheme types.
>
> Do you mean closer to a list as in, growing it is cheap?

I am not talking about the algorithmic complexity (which is not at all
clear, see below) but about the API the SRFI 214 can support. As
mentioned by Adam in his document, they behave in many regards more
like lists (see unfold, filter, etc.). In fact, the full
non-persistent list API can be supported by the SRFI 214 entities.

> When I think of vector vs list, the first things that come to mind are:
>
> * O(1) lookup (or O(log n) if implemented as a tree)

Scheme vectors do not need to have O(1) access. In fact, O(log n)
access is a plausible implementation model.