On Sun, 22 Feb 2009 14:02:53 +0300, Mattias Holm <[email protected]>
wrote:
I think that the following would work reasonably well:
allow the [] operator for arrays to take comma separated lists of
indices.
So the OpenCL like statement:
v.xyzw = v2.wzyx;
will be written as:
v[0,1,2,3] = v2[3,2,1,0];
Would this be ok? This is a general extension of the array slicing, and
it might be possible to permute with a combination of slices and indices
like this (i.e. v[0..3, 6, 5, 7.. len]). Is permutation operations
something that Walter would be willing to add?
As said by someone else in this thread, there need to be a way to
specify that static arrays are passed by value, so can the ref keyword
be paired with the oposite "byval" or something similar.
And also, functions need to be able to return static arrays which is not
possible at the moment.
Note that the support should be general and work with any array type (so
that you can get YMM support whenever that makes it into the future
chips).
/ Mattias
How would you implement it for user-defined types?