Array initialization
Stefano Corsi <[email protected]> Mon, 27 Jan 2003 16:31:42 +0000
| Newsgroups | gmane.comp.lang.moto.devel |
|---|---|
| Organization | Moto Project |
| Message-ID | <[email protected]> |
I'm working on array initialization and I've managed to get to this point (at
least in interpreter mode...).
Array[] pippo = [
[1,2],
[2,4],
[
[8,9],
[10,11]
]
];
print (<int[]>(<Array[]>pippo[2])[1])[1];
At the moment I've used square brackets for being confortable with the
grammar. Of course it could be possible to use curlies, with some more
effort...
Isn't the print statement too awkward? Do you think an implicit cast so that
you can do:
print pippo[2][1][1];
could be easily done?
With simple one-dimensional array it work fine without casts (not even at
initialization time. I get the tipe from the first value in the list...).
Stefano