wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Support multi-dimensional arrays #27

Open wc-duck opened 8 years ago

wc-duck commented 8 years ago

Add support for multi-dimensional arrays such as "uint32[][]", "uint32[5][]" and uint32[][6]". Prerequisite is to rewrite json-parse since that would simplify this feature ALOT!

lundmark commented 8 years ago

Is this really wanted? multi-dimensional arrays are generally pretty hard to use tbh. I think it's better if people just use:

uint32[x*y];

and then just index with i*x+j when iterating?

wc-duck commented 8 years ago

Iterating like that only works for fixed size arrays... the above would also work with "dynamic"-size arrays.

Also supporting fixed size multidim arrays is really easy and shouldn't be much code at all so I think it could as well be supported.