Hi Mark:
On 04.06.2022 22:38, Mark L. Gaubatz via Oorexx-devel wrote:
Since the original version of ooRexx, without a declaration of how to view the multi-dimensional
objects sparsely, results are generically indeterminate as mapping is based on the highest indices
used. Thus, either an .array~new(6,7)specification is required, or the first element initialized
must reference the highest indices to be used. Otherwise, the array is effectively remapped with
each use.
Consequently, if the first use sets element [6,7], then a specification of
.array~newworks properly.
Hmm, I think there is a misunderstanding here. ooRexx arrays when created with the message NEW
without any arguments that would denote dimensionality information has no dimensionality at first.
Sending such an array at this stage the message DIMENSION will return 0 to indicate this fact.
The first assignment of a value to the array determines the dimensions, depending on the number of
indices used. If one index got used, the array has a DIMENSION of 1, if two indices got used the
array has a DIMENSION of 2 and so on.
A notable feature of ooRexx arrays is that no maximum capacity need to be stated. If the initial
capacity is given in the NEW message with arguments, then these upper limits can be increased at any
time. In such a case, if I understand it correctly, a new backing array gets created with the new
size and the elements get copied from the old backing array to the new. It seems that something goes
wrong there as all existing elements should occupy the same positions (have the same indices) in the
new backing array.
In your example the capacity of the array is already large enough to store all elements of the
example, i.e., there is no need to enlarge the backing array therefore this error does not surface.
Arrays are a central data structure in ooRexx and its implementation is quite comprehensive with a
lot of interdependencies it seems, so I do not dare to touch that area myself, short of time (had to
invest too much time in OLEObject and changing the scope resolution already; was interesting to
learn new things, but having a challenging day job with many different obligations, I just have run
out of time as other tasks are almost overdue and need my urgent attention in the next weeks; e.g.
over here the semester ends at the end of June, followed by grading, but also reading and correcting
e.g. seminar papers and the like; also, once gaining more time there are two to three hot items on
my table: getting some of the new ooRexx 5 native APIs into BSF4ooRexx such that the Java
programmers can use them, writing a little book on BSF4ooRexx from scratch to make it easy to use
ooRexx with the Java bridge which among other things allows one to implement Java methods in ooRexx
and allows Java programmer to run ooRexx scritps via the Java scripting framework; the third item is
the concurrent tracing where the code has been done and what is needed is to agree on how to make it
available to the ooRexx programmers, had experimented with that so would not need too much time to
invest for it).
---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel