The question is: is there an alternative syntax to create an array of a specific length. Now you have to go through a static method of System.Array to create it.

I wanted to know if you can create it directly and keep it looking like System.Array[int]. Something like: System.Array[int](3). But this throws an exception.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J. Merrill
Sent: Friday 8 September 2006 18:57
To: Discussion of IronPython
Subject: Re: [IronPython] System.Array

 

Did you leave some part of your own question un-answered?  CreateInstance does just what you said you wanted to know how to do, doesn't it?

At 04:22 AM 9/8/2006, Kristof Wagemans wrote

You can create an int array of length 3 with:
System.Array[int]((1,2,3))
 
Is there an alternative syntax to create an int array of length 3 without passing in a tuple with 3 values? I know that I can create one with:
System.Array.CreateInstance(int,3)



J. Merrill / Analytical Software Corp
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to