Emphasis on simple !
Not to discredit the workarounds, they are all nice ideas in their own way, it's just they are so convoluted, depressing to type and to read later compared to what you should be able to do in the first place.
Just think when you have to initialize simple vectors for points or colors in game or graphic programming.
Would be so nice to be able to do
or
if the precedent is "too difficult" for the compiler
resulting in
debug vec(0) = 1.0
...
debug vec(2) = 3.0
Lunasole wrote:for multidimensional/structured arrays should not be applicable.
why not ? at least for multidimensional arrays
Code: Select all
Dim mat.f() = (1.0, 2.0, 3.0) (4.0, 5.0, 6.0) (7.0, 8.0, 9.0) or Dim mat.f() = (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0)
or
Code: Select all
Dim mat.f(2,2) = (1.0, 2.0, 3.0) (4.0, 5.0, 6.0) (7.0, 8.0, 9.0) or Dim mat.f(2,2) = (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0)
if the precedent is "too difficult" for the compiler
resulting in (row major order)
debug mat(0,0) = 1.0
debug mat(0,1) = 2.0
debug mat(0,2) = 3.0
debug mat(1,0) = 4.0
debug mat(1,1) = 5.0
debug mat(1,2) = 6.0
debug mat(2,0) = 7.0
debug mat(2,1) = 8.0
debug mat(2,2) = 9.0
All the above while keeping the support for the Static keyword to initialize an array only once inside a procedure if possible.
Simple but useful enhancements to the language are much more needed IMO than another library and this one in particular should be extremely easy to add for the predefined data types.