Will C# support static array?


(James Esword) #1

I’m doing some matrix calculation things on Cocoa and find static array is not supported in RO C# (https://docs.elementscompiler.com/API/StandardTypes/Arrays/). Is there a plan to add this feature for C#?


(Carlo Kok) #2

I suppose we could add it, if we find a good syntax for it.


(James Esword) #3

Maybe

double[] vector[4];
double[,] matrix[4,4];

is an option?


(Carlo Kok) #4

not really. It has to be part of the type sig, not in initialization.


(James Esword) #5

So

double[4] vector;
double[4,4] matrix;

is feasible?


(Carlo Kok) #6

I’ll consider it.


(RemObjects) #7

Thanks, logged as bugs://75328


(Carlo Kok) #8

This will work now:

namespace issue75328_static_arraytest
{
struct A{ 
  fixed byte x[1024];
  fixed byte xs[1024,2];
		
}
	class Test
	{
	  A z;
	  public static void Main()
		{
		  fixed byte x[1024];
		  fixed byte xs[1024,2];
		}

	}
}

(RemObjects) #9

bugs://75328 got closed with status fixed.