Should we add `a * b` for vectors?

Manu turkeyman at gmail.com
Sun Sep 24 05:24:57 UTC 2017


On 23 September 2017 at 03:11, Ilya Yaroshenko via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> Should we add `a * b` to ndslice for 1d vectors?
> Discussion at https://github.com/libmir/mir-algorithm/issues/91
>

I often ponder this sort of question... and while the nerdy bit of my would
love to see this, I can never get past the fact that `is(typeof(a) !=
typeof(a * b))`... I feel that's a big enough reason to put a bullet in the
idea. D has array operations, which look just like 1d ndslices, also SIMD
vectors usually implement operators, but they do element-wise operation, so
now there's a confusion.
Consider, a generic function receives some T; if T is a slice or simd, it
does element-wise stuff, if T is an ndslice, it behaves differently. That
doesn't seem right.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20170924/a889b339/attachment-0001.html>


More information about the Digitalmars-d mailing list