[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: AW: AW: Several comments



> They are like the empty set: they seem odd only until they seem second
> nature, at which point they are ordinary and boring.  Rather like
> zero, actually.
>
> What is slightly odder is a matrix of dimension zero; such a matrix
> necessarily has no elements.  This is unusual, because for any other
> dimension, a single-element matrix is possible.  That means that you
> can convert scalars to matrixes for any dimension but zero.
>
> Still, not a big deal.

All right then, from a mathematical point of view, zero-dimensional vectors
are nothing special.

But what about the usage of vectors as a type of data structure? In general,
vectors are allocated with a fixed length, in order to allow access to the
individual elements of the vector in constant time. In some programming
languages, the length of a vector is immutable, once defined, while other
programming languages allow vectors to be resized (R5RS does not). Still, I
would claim that vectors are not dynamical data structures that routinely
have length zero.

On the other hand, I have to admit that several functions defined by SRFI-43
will return zero-dimensional vectors on occasion.

Probably, I'm just too conservative. Anyway, I retract any objections
against defining the predicates vector-empty? and vector-nonempty?.


Regards

Michael Burschik