Array in array

BLM768 blm768 at gmail.com
Sat Oct 27 15:34:04 PDT 2012


Ack! I just realized that this doesn't work because D isn't 
dynamically typed. I've had way too much Ruby on the brain 
lately...

You could use std.variant to simulate dynamic typing, but can be 
a bit of a mess.
You also could do something like this:

int[][] a = [[1], [2, 3, 4], [5]];

That's also a bit ugly, though.
In the end, you'll probably end up structuring your data in some 
other way.

Next time I answer a question, I'd better make sure I'm thinking 
of the right language.


More information about the Digitalmars-d mailing list