Proposal: Multidimensional opSlice solution
bearophile
bearophileHUGS at lycos.com
Tue Mar 9 03:01:10 PST 2010
Norbert Nemec:
> The fundamental issue that I am only gradually beginning to understand
> is that multidimensional arrays are really much more a niche feature
> than they seem. Outside of numerics, hardly anybody actually finds them
> particularly useful.
I don't agree, 2D arrays are useful in many other situations, for example in games to represent a 2D field of characteristics, etc, etc.
But I agree that heavy usage of slices and strides and nD arrays even more complex than your example is common in numerics only:
off = (y[:-1,:]*x[1:,:] - y[1:,:]*x[:-1,:]) / (x[1:,:]-x[:-1,:])
D has a chance to become important for the people doing numerical/array processing, so even if this is a niche purpose, it can be an important niche for D. The introduction of the improved $ by Don means that I am not the only one that shares this idea.
Bye,
bearophile
More information about the Digitalmars-d
mailing list