Bug #3961
closed
RExpression2 - support arrayType(scalar, ....) tokens
Added by ben leinfelder over 15 years ago.
Updated over 15 years ago.
Description
a "mixed" array token can be generated, as in the Ptolemy expression:
{1, 2.3, true}
the type then looks like this:
arrayType(scalar,3)
The RExpression2 actor needs to handle this heterogeneous array accordingly (hopefully we can preserve the type information for each item in the array).
Note: if the array contains a string token, the entire array becomes an arrayType(string...)
1. Added support for treating these arrays as containing all string elements.
2. Looking into how we might preserve each element's type when setting the token in R.
At least it won't throw an error now. Downstream processes (R scripts) will have to be savvy about converting from string representations to number/boolean if need be.
This bug should now read: "Scalar Arrays should not be treated as String Arrays"
might end up closing it if I can't get JRI to handle the heterogeneous array
My only guess with handling heterogenous array items is to use the low-level rniPut(...) methods in JRI and manually assemble the data structures from their memory addresses. (Ick factor multiplying rapidly!)
Original Bugzilla ID was 3961
Also available in: Atom
PDF