http://en.wikipedia.org/wiki/Zero_matrix
On 9 Apr 2014 21:26, "Tommi Tissari" <rusty.ga...@icloud.com> wrote:

> > On 09 Apr 2014, at 20:46, Kevin Ballard <ke...@sb.org> wrote:
> >
> > Why? Zero is the additive identity.
>
> Zero is _an_ additive identity for numbers, but not for vectors or
> matrices.
>
> use std::slice::Items;
> use std::iter::RandomAccessIterator;
> use std::num::Zero;
>
> Items is a RandomAccessIterator, but a RandomAccessIterator is not an
> Items. 0 is an additive identity, but an additive identity is not 0. You
> can't assign a zero to a 2x2 matrix, and therefore this trait is
> incorrectly named. The following just looks wrong:
>
> let m: Matrix = Zero::zero();
>
> > AdditiveIdentity is the only reasonable alternative, but that's a
> mouthful of a name and I think changing the name to this would be more
> confusing.
>
> Naming a trait something that it's not is even more confusing. I don't
> think we should give an incorrect name to this trait on the grounds of the
> correct name being longer. Just look at RandomAccessIterator.
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to