Sorry to dig this out. I know that multidimensional arrays (e.g. String[][])
may be substituted by List<of <List< of YourPreferedType > >.
But there seems to be some kind of language support for them. For instance initialisation works just fine, if you omit the type:
# cobra.bat --version
# Cobra svn:3116 (post 0.9.6) / 2014-07-10 on .NET CLR v4.0.30319 on Microsoft Windows NT 6.1.7601 Service Pack 1
# ...
class TestArray
def main is shared
# this works fine
field0 = @[ @['Marry', 'had', 'a'], @['little','lamb, ','...'] ]
print "Damn' [ field0[0][0] ], it works! "
But declaring the type...
class TestArray
def main is shared
# this does not compile
field1 as String[] = @[ @['marry', 'had', 'a'], @['little','lamb, ','...'] ]
field2 as String[][] = @[ @['marry', 'had', 'a'], @['little','lamb, ','...'] ]
print field1[0][2], " in the context of ", field2[1][1]
... produces the compiler messages
# cobra.bat CobraTest.cobra
CobraTest.cobra(9): error: Incompatible types. Cannot assign value of type String[][] on the right to String[] on the left.
CobraTest.cobra(10): error: Invalid index expression or array type.
I understand there has been a patch which (allegedly) supports mulidimensional arrays.
What would it take to have it in the release?
kind regards
ptokremin