autowrap v0.0.1 - Automatically wrap existing D code for use in Python and Excel
Laeeth Isharc
laeeth at laeeth.com
Mon May 14 04:34:55 UTC 2018
On Sunday, 13 May 2018 at 16:23:49 UTC, Nikos wrote:
> I'm trying to wrap drepl
> (https://github.com/dlang-community/drepl)
>
> My dub.sdl files is
>
>>import autowrap.python;
>>mixin(
>> wrapAll(
>> LibraryName("drepl"),
>> Modules("drepl.interpreter"),
>> )
>>);
>
> I also flagged `export` the interpreter function
>
>>export Interpreter!Engine interpreter(Engine)(return scope
>>Engine e) if (isEngine!Engine)
>>{
>> // workaround Issue 18540
>> return Interpreter!Engine(() @trusted { return move(e);
>> }());
>>}
>
> I build the library with python35, but when I import it from
> python idle, I cannot access the `interpreter` function at all.
> I have the feeling I miss something essential here, but I don't
> know what it is.
> Any ideas?
It won't wrap a templated type or function. You will have to
make a little shim that instantiates the templated function with
a particular type.
More information about the Digitalmars-d-announce
mailing list