[quote=141310:@Karen Atkocius]I am aware of all of that… But often times creating a new class is overkill and often a specific class should be a friend class…
For simplicity of information hiding (as well as speed of execution) it would be easier just to be able to define such a property on relevant classes.[/quote]
You could make a class (like Christian suggested) called MyArrayHolder for example. You could then simply make a property for each type that this array can hold. You could then create an array of MyArrayHolders and use that.
I know Christian already suggested this but I am just explaining it. This would be a better approach than multidemensional arrays for simplicity’s sake. For performance and probably easier debugging you should (mostly) avoid variants.
And yes it would be easier if you could do this directly but by the looks of things this is the way to go.
[quote=141356:@Oliver Scott-Brown]You could make a class (like Christian suggested) called MyArrayHolder for example. You could then simply make a property for each type that this array can hold. You could then create an array of MyArrayHolders and use that.
[/quote]
As I said I know how to work around it… and i fact have been doing it for over a decade.
My point was that creating objects for something like that is unnecessarily expensive. Ideally I would like to see language and framework features that help with speed and was looking to see if there was any enthusiasm for this idea.
Speed & memory efficiency would suggest you should use something like a sparse array which you can create using a dictionary
That way most lookups are not linear searches but O(1) operations based on a hashed key
A sparse array assumes that all the array elements do not need to be populated… When I’ve used arrays of arrays in another language all elements were used so there was no point to that.
Also if all I need to to do is iterate through the elements of each array in order, or who’s indices I already know, then dictionaries lookups are still more overhead and using them is kind of pointless… Never mind the overhead of object creation, which is inherent as variants are objects .
In general I am just concerned about the costs of the tendency towards everything needing to be an object to get things done.
As I mentioned elsewhere, computing power these days seem to be increasing by adding more cores rather than making the cores faster as in the old days… And Xojo apps (without helper apps) only use a single core.
Arrays of Arrays could be implemented under the hood to be very efficient both in execution and memory usage compared to other strategies…
But I can see now that this is likely to go nowhere.
I think arrays of arrays would be a pretty hefty change to the language and the runtime
So I have my doubts that it’d fly but you can always submit a request if there isn’t one already