bug-guile
[Top][All Lists]
Advanced

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

Re: generic * and 0


From: Marius Vollmer
Subject: Re: generic * and 0
Date: Wed, 06 Dec 2006 17:52:43 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> The only case I can think of where a common zero may not be good is
> with matrices, where "(* 0 matrix) => matrix" could preserve the
> dimensions of the input matrix in the output matrix.

I would have to dig for the specifics (having forgotton most of my
math by now), but 'scaling' matrices and 'multiplying' them are
actually two different operations.  They are unfortunately notated the
same. (* scalar matrix) is scaling, and (* matrix matrix) is
multiplying.  A special case of this is the more familiar vector
scaling versus the vector dot product, I think.

Thus, it makes sense to me to let the 'unknown' object in a call to an
arithmetic operation decide how to interpret it, and not doing any
shortcuts.

In general, it is not guaranteed that (* 0 something) is even
well-defined, it might be an error.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

[Prev in Thread] Current Thread [Next in Thread]