DasBetterR
jmh530
john.michael.hall at gmail.com
Fri Jun 30 20:02:27 UTC 2023
On Friday, 30 June 2023 at 18:47:06 UTC, bachmeier wrote:
> [snip]
>
> I assume you mean that you've allocated memory on the D side,
> like this:
>
> ```
> auto a = new double[24];
> a[] = 1.6;
> Slice!(double*, 1) s = a.sliced();
> ```
>
> and you want to pass s to R for further analysis.
> Unfortunately, that will not work. R functions only work with
> memory R has allocated. It has a single struct type, so there's
> no way to pass s in this example to R.
Unfortunate, but understood. Looking at the implementation for
Vector, the implementation of the constructor and opAssign look
like it has to copy the data over anyway.
>
> [snip]
>
> As much fun as it is to figure these things out, I have never
> had sufficient time or motivation to do so.
Yeah, that seems like it would be a bit hairy to figure out.
More information about the Digitalmars-d-announce
mailing list