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

Vectors as functions




On Donnerstag, August 14, 2003, at 07:01  Uhr, Robby Findler wrote:

> As far as vectors as functions, it means that the vector selection
> operation becomes applying a vector (as a function) to a number.
> Mutation would be applying it to two values, a number as index and new
> value to store at that index.

While this might be aesthetic from a mathematical point of view, I 
think this most probably leads to harder to find bugs. Think about 
(apply vec arglist) - this would have strongly different semantics 
depending on the size of arglist. I'd prefer this to throw an exception 
for the wrong number of arguments instead of letting this go through 
unnoticed.

In general, I think one shouldn't unify things that are strongly 
different.


Pascal