[IronPython] System.Array

Dino Viehland dinov at exchange.microsoft.com
Fri Sep 8 19:30:51 CEST 2006


We thought that CreateInstance was a handy enough way to do this so we didn't re-invent the wheel.  Given our current syntax for creating an array requiring a sequence we've left the window open to add your proposed syntax in the future but it'd be interesting to hear how cumbersome others think the CreateInstance call is.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kristof Wagemans
Sent: Friday, September 08, 2006 10:12 AM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] System.Array

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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060908/67a5b1f3/attachment.html>


More information about the Ironpython-users mailing list