PyD-like wrapping for Excel/VBA and Julia?

Ellery Newcomer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 18 17:59:04 PST 2014


On 12/18/2014 12:41 PM, Laeeth Isharc wrote:
> I have a bunch of D functions I would like to make available to Excel
> (and possibly Julia) without having to write wrappers for each function
> individually.
>

I've thought about refactoring the reflection parts of pyd into a 
reusable library for e.g. resurrecting RuD. Come to think of it, that 
would probably be necessary for supporting pypy.

It'd be a heck of a lot of work, though.



For your wrapper, you can probably do something like

extern(Windows) double vbwrap_test(double* inp,size_t num_inp,double* 
oup,size_t num_oup)
{
     return test(inp[0 .. num_inp], arg_oup[0 .. num_oup]);
}

with .dup sprinkled in as you see fit. And you don't need to explicitly 
copy the results back! Might need to take the ref off oup in test..


More information about the Digitalmars-d-learn mailing list