Coder Social home page Coder Social logo

symmetryinvestments / autowrap Goto Github PK

View Code? Open in Web Editor NEW
80.0 11.0 16.0 3.69 MB

Wrap existing D code for use in Python, Excel, C#

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.66% D 73.24% Python 15.19% Shell 0.35% C# 9.57%
python dlang excel data-science metaprogramming cfte pyd autowrap csharp

autowrap's Introduction

autowrap

CI Build Status Coverage

Wrap existing D code for use in other environments such as Python, Excel, and .NET.

Building

To build and test all the code, run ci/test-all.sh

About

There are projects already to make it possible to use D code from Python and from Excel.

In PyD, the functions and data structures must be registered manually, and while the same isn't true of excel-d, the latter wraps everything in the modules reflected on. When writing code specifically for Excel, that is clearly what the user wants (and if not it can be made private). When wrapping pre-existing D code, however, it makes sense to opt-in instead by requiring functions to be wrapped to be marked export. If one wants to wrap all functions regardless of export, use version=AutowrapAlwaysExport.

There is ppyd that makes the effort required to use pyd a lot less but that requires using a UDA. Again, when writing code specifically for Python use this makes sense, but adds a dependency that "dirties" pre-existing D code.

This dub package makes it possible to wrap pre-existing D code "from the outside", imposing no dependencies on the aforementioned body of work.

autowrap also does away with the boilerplate necessary to creating a Python extension with PyD. Things should just work.

To wrap for Python, make a dub dynamicLibrary project with one file:

import autowrap.python;
mixin(
    wrapDlang!(
        LibraryName("mylibrary"),
        Modules("my.module1", "my.module2", /* ... */),
    )
);

Assuming the dub package name is also "mylibrary", you should get libmylibrary.so/mylibrary.dll. If the former, rename it to mylibrary.so and you'll be able to use it from Python:

import mylibrary

mylibrary.func1()

The camelCase D functions are wrapped by snake_case Python functions, but struct members have the same names.

It is also possible to wrap all functions regardless of their export status on a module-by-module basis. To do so, instead of using a string to designate the module, do this instead:

Modules("my.module1", Module("my.module2", Yes.alwaysExport))

To wrap for Excel:

import autowrap.excel;

mixin(
    wrapAll!(
        "my.module1", "my.module2", /* ... */
    )
);

The camelCase D functions will be PascalCase in Excel.

Python versions

Since autowrap depends on PyD, the version of python to use must be specified. You can either specify the configuration explicity, e.g. subConfiguration "autowrap:python" "python36" or you can use the default env configuration. In order to build using the env configuration your must first set the relevant environment variables using the pyd_set_env_vars.{sh,bat} scripts, which you can copy to your current working directory by running dub run pyd:setup. See the pyd docs for more information.

.NET Support

Autowrap can also generate C# bindings to D libraries. Generating bindings for C# is a two-step process. First we must generate a C# compatible C-interface for the D library, then we build and run a version of the library that emits the corresponding C# interface code.

What Works:

  • Module Functions
  • Primitive Types
    • string
    • wstring
    • dstring
    • byte
    • ubyte
    • short
    • ushort
    • int
    • uint
    • long
    • ulong
    • float
    • double
  • Structs
    • Fields
    • Properties
    • Methods
  • Classes
    • Constructors
    • Fields
    • Properties
    • Methods

1-Dimensional Ranges are implemented but only lightly tested and may not work in all cases. Higher dimensional ranges are not supported.

Generating .NET Interfaces

To generate the C-interface use the following example replacing "csharp" with the dub name of your library (ex: csharp builds to libcsharp.so) and replace "csharp.library" with the name of the module you want to wrap.

import csharp.library;
import autowrap.csharp;

mixin(
    wrapCSharp("csharp",
        Modules(
            Module("csharp.library")
        )
    )
);

To generate the C# interface use the emitCSharp mixin as follows to dump the output to a location of your choice. This mixin creates a void main() function that will need to be executed by running the code. (This is due to the inability of CTFE to write files to the disk.)

mixin(
    emitCSharp(
        Modules(
            Module("csharp.library")
        ),
        OutputFileName("Wrapper.cs"),
        LibraryName("csharp"),
        RootNamespace("csharp")
    )
);

Full Example

module csharp.wrapper;

import csharp.library;
import autowrap.csharp;

immutable Modules modules = Modules(Module("test"));

mixin(
    wrapCSharp(
        Modules(
            Module("csharp.library")
        ),
        OutputFileName("Wrapper.cs"),
        LibraryName("csharp"),
        RootNamespace("csharp")
    )
);

Our sponsors

       

autowrap's People

Contributors

alexandrumc avatar atilaneves avatar dependabot[bot] avatar inkrementator avatar jmdavis avatar john-colvin avatar kaleidic avatar kinke avatar laeeth avatar lightbender avatar marler8997 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autowrap's Issues

Autowrap an entire package

Is there some way we could find all modules in a package and wrap them? I initially thought yes but now I'm unsure. Either way, it would be nice.

If a function returns a T* then T should be registered

Works I think in below modified version

// T -> T, T[] -> T, T[][] -> T
private template PrimordialType(T) if(isArray!T) {
    import std.range.primitives: ElementType;
    //static if(isArray!(ElementType!T))
        alias PrimordialType = PrimordialType!(ElementType!T);
    //else
     //   alias PrimordialType = PrimordialType!(ElementType!T);
}


// T -> T, T[] -> T, T[][] -> T
private template PrimordialType(T) if(!isArray!T) {
	import std.traits:isPointer;
    static if(isPointer!T)
	    alias PrimordialType = PrimordialType!(typeof(*T));
    else
	    alias PrimordialType = T;
}

Class members not wrapped

This is a pyd issue.

class Foo {
    int i;
}

Results in:

/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_wrapper.d(127,35): Error: no property shim for type Member!"i"
/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_wrapper.d(127,58): Error: template instance `pyd.make_wrapper.class_decls!(3u, Foo, Init!int, Repr!(toString), Def!(bar), Member!"i")` error instantiating
/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_wrapper.d(127,58):        instantiated from here: class_decls!(2u, Foo, Init!int, Repr!(toString), Def!(bar), Member!"i")
/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_wrapper.d(127,58):        instantiated from here: class_decls!(1u, Foo, Init!int, Repr!(toString), Def!(bar), Member!"i")
/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_wrapper.d(137,21):        instantiated from here: class_decls!(0u, Foo, Init!int, Repr!(toString), Def!(bar), Member!"i")
/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/class_wrap.d(1536,32):        ... (3 instantiations, -v to show) ...
../../python/source/autowrap/python/wrap.d(104,13):        instantiated from here: wrapAggregate!(Foo)

python3.7 tests broken

% make
cd examples/simple && dub build -c python37
Performing "debug" build using /usr/bin/dmd for x86_64.
autowrap:reflection 0.1.3: target for configuration "library" is up to date.
simple ~master: building configuration "python37"...
Running pre-build commands...
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4904,5): Deprecation: class allocators have been deprecated, consider moving the allocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4908,5): Deprecation: class deallocators have been deprecated, consider moving the deallocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4041,5): Deprecation: class allocators have been deprecated, consider moving the allocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4045,5): Deprecation: class deallocators have been deprecated, consider moving the deallocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4904,5): Deprecation: class allocators have been deprecated, consider moving the allocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4908,5): Deprecation: class deallocators have been deprecated, consider moving the deallocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4041,5): Deprecation: class allocators have been deprecated, consider moving the allocation strategy outside of the class
/home/john/.dub/packages/pyd-master/pyd/infrastructure/util/multi_index.d(4045,5): Deprecation: class deallocators have been deprecated, consider moving the deallocation strategy outside of the class
Linking...
To force a rebuild of up-to-date targets, run again with --force.
cp examples/simple/libsimple.so examples/simple/simple.so
PYTHONPATH=/home/john/Git/autowrap/examples/simple pytest -s -vv tests/test_simple.py
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.7.0, pytest-3.6.4, py-1.5.4, pluggy-0.7.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /home/john/Git/autowrap, inifile:
collected 0 items / 1 errors

=========================================================================================== ERRORS ============================================================================================
____________________________________________________________________________ ERROR collecting tests/test_simple.py ____________________________________________________________________________
ImportError while importing test module '/home/john/Git/autowrap/tests/test_simple.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.7/site-packages/_pytest/python.py:468: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python3.7/site-packages/py/_path/local.py:668: in pyimport
    __import__(modname)
/usr/lib/python3.7/site-packages/_pytest/assertion/rewrite.py:226: in load_module
    py.builtin.exec_(co, mod.__dict__)
tests/test_simple.py:1: in <module>
    from simple import (Prefix, Adder, IntString, create_int_point, create_outer,
E   ImportError: /home/john/Git/autowrap/examples/simple/simple.so: undefined symbol: _PyThreadState_Current
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================================== 1 error in 0.09 seconds ===================================================================================
make: *** [Makefile:11: test_simple] Error 2

not caught by travis because travis appears to be only building python27

python comment in boilerplate.d is wrong

The following should just be wrapAll - no template argument.

/**
   Necessary boilerplate for pyd.
   To wrap all functions/return/parameter types and  struct/class definitions from
   a list of modules, write this in a "main" module and generate mylib.{so,dll}:
   ------
   mixin wrapAll!(LibraryName("mylib"), Modules("module1", "module2", ...));
   ------
 */
module autowrap.python.boilerplate;

Error in wrapCSharp on Windows

Thank you for the interesting library.:+1:

I tried the wrapCSharp on Windows, but a compile error occurred.

Error: only one main, WinMain, or DllMain allowed. Previously found main at source\csharp\wrapper.d-mixin-6(100,31)

The cause is the following in boilerplate.d.
https://github.com/kaleidicassociates/autowrap/blob/master/csharp/source/autowrap/csharp/boilerplate.d#L43

I avoided errors in the following way, because I wanted to run examples.

        //Insert DllMain for Windows only.
        version(Windows) {
            version(EmitCSharp) {
            } else {
                %3$s
            }
        }

        version (EmitCSharp) {
            void main() {
                import std.stdio;
                string generated = generateCSharp!(%2$s)(LibraryName("%4$s"), RootNamespace("%5$s"));
                auto f = File("%6$s", "w");
                f.writeln(generated);
            }
        }

I'm glad if it is fixed.

Regards

Wrap const arguments and return type for python and SIL

Not sure what to do. Maybe just copy and dup if argument copyable. So you register a lambda as a shim that takes whatever pyd gives you and passes it to function in form required. And it strips off const on return as I think pyd doesn't know what to do with that.

Can't convert user-defined struct despite registration

import structs: String;
void func(String str) { }
from simple import String, func
func(String())
E       RuntimeError: D Exception:
E       pyd.make_object.PydConversionException@/home/atila/.dub/packages/pyd-master/pyd/infrastructure/pyd/make_object.d(689): Couldn't convert Python type 'String' to D type 'structs.String'
E       ----------------
E       ??:? void pyd.make_object.could_not_convert!(structs.String).could_not_convert(deimos.python.object.PyObject*, immutable(char)[], immutable(char)[], ulong) [0x30aa3333]
E       ??:? structs.String pyd.make_object.python_to_d_try_extends!(structs.String).python_to_d_try_extends(deimos.python.object.PyObject*) [0x30aa33c0]
E       ??:? structs.String pyd.make_object.python_to_d!(structs.String).python_to_d(deimos.python.object.PyObject*) [0x30aa2e2a]
E       ??:? void pyd.func_wrap.applyPyTupleToAlias!(issues.takesInString(structs.String), "takes_in_string").applyPyTupleToAlias(deimos.python.object.PyObject*, deimos.python.object.PyObject*) [0x30aa2670]
E       ??:? deimos.python.object.PyObject* pyd.func_wrap.pyApplyToAlias!(issues.takesInString(structs.String), "takes_in_string").pyApplyToAlias(deimos.python.object.PyObject*, deimos.python.object.PyObject*) [0x30aa2520]
E       ??:? deimos.python.object.PyObject* pyd.func_wrap.function_wrap!(issues.takesInString(structs.String), "takes_in_string").func(deimos.python.object.PyObject*, deimos.python.object.PyObject*, deimos.python.object.PyObject*).__dgliteral4() [0x30aa2501]
E       ??:? deimos.python.object.PyObject* pyd.exception.exception_catcher!(deimos.python.object.PyObject*).exception_catcher(deimos.python.object.PyObject* delegate()) [0x30a92bfc]
E       ??:? extern (C) deimos.python.object.PyObject* pyd.func_wrap.function_wrap!(issues.takesInString(structs.String), "takes_in_string").func(deimos.python.object.PyObject*, deimos.python.object.PyObject*, deimos.python.object.PyObject*) [0x30aa24da]
E       ??:? _PyMethodDef_RawFastCallKeywords [0x3291b303]

tests/test_issues.py:7: RuntimeError

Excel-d version upgrade?

The version specified here tries to wrap private members, which causes compilation errors with dmd 2.087

Can't wrap functions that return pointers to structs that can't be wrapped

struct Uncopiable {
    @disable this(this);
    double x;
}

export auto uncopiablePtr(double d = 33.3) {
    return new Uncopiable(d);
}

Calling this from python:

assert uncopiable_ptr(33.3).d == 33.3

Yields:

RuntimeError: D conversion function d_to_python failed with type issues.Uncopiable*

Uncopiable isn't wrappable due to not being copiable, and as such it's not registered.

typo in autowrap.reflection

        alias RecursiveAggregatesImpl = T;

The line above should be singular - RecursiveAggregateImpl - not plural.

private mixin template RecursiveAggregateImpl(T, alias Other) {
    import std.meta: staticMap, Filter, AliasSeq, NoDuplicates;
    import std.traits: isInstanceOf, Unqual;
    import std.typecons: Typedef, TypedefType;
    import std.datetime: Date;

    static if(isInstanceOf!(Typedef, T)) {
        alias RecursiveAggregateImpl = TypedefType!T;
    } else static if (is(T == Date)) {
        alias RecursiveAggregateImpl = Date;
    } else static if(isUserAggregate!T) {
        alias AggMember(string memberName) = Symbol!(T, memberName);
        alias members = staticMap!(AggMember, __traits(allMembers, T));
        enum isNotMe(U) = !is(Unqual!T == Unqual!U);

        alias types = staticMap!(Type, members);
        alias primordials = staticMap!(PrimordialType, types);
        alias userAggregates = Filter!(isUserAggregate, primordials);
        alias aggregates = NoDuplicates!(Filter!(isNotMe, userAggregates));

        static if(aggregates.length == 0)
            alias RecursiveAggregateImpl = T;
        else
            alias RecursiveAggregateImpl = AliasSeq!(aggregates, staticMap!(Other, aggregates));
    } else
        alias RecursiveAggregatesImpl = T;
}

C# wrapping broken for templated structs

version(WrapCSharp)
{
        import autowrap.csharp;
        immutable Modules modules=Modules(Module("foo"));
        mixin(
                        wrapCSharp(
                                Modules(
                                        Module("foo"),
                               ),
                                OutputFileName("foo.cs"),
                                LibraryName("foo"),
                                RootNamespace("foo"),
                        ),
        );
}


 dwave git:(wrapcsharp) ✗ cat source/foo.d
struct Foo(T)
{
        T foo;
}

alias FooDouble = Foo!double;

export auto makeFooDouble(double x)
{
        return FooDouble(x);
}



source/app.d-mixin-17-mixin-99(1112,80): Error: semicolon expected, not !
source/app.d-mixin-17-mixin-99(1112,80): Error: declaration expected, not !
source/app.d-mixin-17-mixin-99(1115,25): Error: function declaration without return type. (Note that constructors are always named this)
source/app.d-mixin-17-mixin-99(1115,27): Error: no identifier for declarator rt_moduleTlsCtor()
source/app.d-mixin-17-mixin-99(1116,14): Error: declaration expected, not (
source/app.d-mixin-17-mixin-99(1117,14): Error: declaration expected, not (
source/app.d-mixin-17-mixin-99(1119,25): Error: function declaration without return type. (Note that constructors are always named this)
source/app.d-mixin-17-mixin-99(1119,35): Error: no identifier for declarator __temp__.reserve(capacity)
source/app.d-mixin-17-mixin-99(1120,19): Error: unexpected ( in declarator
source/app.d-mixin-17-mixin-99(1120,20): Error: basic type expected, not cast
source/app.d-mixin-17-mixin-99(1120,20): Error: found cast when expecting )
source/app.d-mixin-17-mixin-99(1120,24): Error: no identifier for declarator pinPointer(_error_)
source/app.d-mixin-17-mixin-99(1120,24): Error: semicolon expected following function declaration
source/app.d-mixin-17-mixin-99(1120,24): Error: declaration expected, not (
source/app.d-mixin-17-mixin-99(1121,9): Error: declaration expected, not return

---
example of what's broken

extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)Create(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        foo.Foo!(double)[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(foo.Foo!(double)[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
---- full code
import core.thread : thread_attachThis, thread_detachThis;
extern(C) void rt_moduleTlsCtor();
extern(C) void rt_moduleTlsDtor();
import foo;

extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        string[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(string[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringSlice(string[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        string[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(string[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string) autowrap_csharp_slice_StringGet(string[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(string)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_StringSet(string[] slice, size_t index, string set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringAppendValue(string[] slice, string append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringAppendSlice(string[] slice, string[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        wstring[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(wstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringSlice(wstring[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        wstring[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(wstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring) autowrap_csharp_slice_WstringGet(wstring[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(wstring)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_WstringSet(wstring[] slice, size_t index, wstring set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringAppendValue(wstring[] slice, wstring append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringAppendSlice(wstring[] slice, wstring[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        dstring[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(dstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringSlice(dstring[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        dstring[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(dstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring) autowrap_csharp_slice_DstringGet(dstring[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(dstring)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_DstringSet(dstring[] slice, size_t index, dstring set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringAppendValue(dstring[] slice, dstring append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringAppendSlice(dstring[] slice, dstring[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        bool[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(bool[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolSlice(bool[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        bool[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(bool[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool) autowrap_csharp_slice_BoolGet(bool[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(bool)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_BoolSet(bool[] slice, size_t index, bool set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolAppendValue(bool[] slice, bool append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolAppendSlice(bool[] slice, bool[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        byte[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(byte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteSlice(byte[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        byte[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(byte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte) autowrap_csharp_slice_ByteGet(byte[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(byte)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_ByteSet(byte[] slice, size_t index, byte set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteAppendValue(byte[] slice, byte append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteAppendSlice(byte[] slice, byte[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ubyte[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ubyte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteSlice(ubyte[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ubyte[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ubyte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte) autowrap_csharp_slice_UbyteGet(ubyte[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ubyte)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UbyteSet(ubyte[] slice, size_t index, ubyte set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteAppendValue(ubyte[] slice, ubyte append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteAppendSlice(ubyte[] slice, ubyte[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        short[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(short[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortSlice(short[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        short[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(short[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short) autowrap_csharp_slice_ShortGet(short[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(short)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_ShortSet(short[] slice, size_t index, short set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortAppendValue(short[] slice, short append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortAppendSlice(short[] slice, short[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ushort[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ushort[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortSlice(ushort[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ushort[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ushort[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort) autowrap_csharp_slice_UshortGet(ushort[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ushort)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UshortSet(ushort[] slice, size_t index, ushort set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortAppendValue(ushort[] slice, ushort append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortAppendSlice(ushort[] slice, ushort[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        int[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(int[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntSlice(int[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        int[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(int[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int) autowrap_csharp_slice_IntGet(int[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(int)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_IntSet(int[] slice, size_t index, int set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntAppendValue(int[] slice, int append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntAppendSlice(int[] slice, int[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        uint[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(uint[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintSlice(uint[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        uint[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(uint[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint) autowrap_csharp_slice_UintGet(uint[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(uint)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UintSet(uint[] slice, size_t index, uint set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintAppendValue(uint[] slice, uint append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintAppendSlice(uint[] slice, uint[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        long[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(long[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongSlice(long[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        long[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(long[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long) autowrap_csharp_slice_LongGet(long[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(long)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_LongSet(long[] slice, size_t index, long set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongAppendValue(long[] slice, long append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongAppendSlice(long[] slice, long[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ulong[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ulong[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongSlice(ulong[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ulong[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ulong[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong) autowrap_csharp_slice_UlongGet(ulong[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ulong)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UlongSet(ulong[] slice, size_t index, ulong set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongAppendValue(ulong[] slice, ulong append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongAppendSlice(ulong[] slice, ulong[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        float[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(float[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatSlice(float[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        float[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(float[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float) autowrap_csharp_slice_FloatGet(float[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(float)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_FloatSet(float[] slice, size_t index, float set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatAppendValue(float[] slice, float append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatAppendSlice(float[] slice, float[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        double[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(double[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleSlice(double[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        double[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(double[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double) autowrap_csharp_slice_DoubleGet(double[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(double)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_DoubleSet(double[] slice, size_t index, double set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleAppendValue(double[] slice, double append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleAppendSlice(double[] slice, double[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)Create(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        foo.Foo!(double)[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(foo.Foo!(double)[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)Slice(foo.Foo!(double)[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        foo.Foo!(double)[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(foo.Foo!(double)[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)) autowrap_csharp_slice_Foo_Foo!(double)Get(foo.Foo!(double)[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double))(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double))(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_Foo_Foo!(double)Set(foo.Foo!(double)[] slice, size_t index, foo.Foo!(double) set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)AppendValue(foo.Foo!(double)[] slice, foo.Foo!(double) append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double)[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)AppendSlice(foo.Foo!(double)[] slice, foo.Foo!(double)[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double)[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)) autowrap_csharp_FooMakeFooDouble(double x) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double))(makeFooDouble(x));
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double))(__ex__);
    }
}

--- whole mixin
import core.thread : thread_attachThis, thread_detachThis;
extern(C) void rt_moduleTlsCtor();
extern(C) void rt_moduleTlsDtor();
import foo;

extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        string[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(string[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringSlice(string[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        string[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(string[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string) autowrap_csharp_slice_StringGet(string[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(string)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_StringSet(string[] slice, size_t index, string set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringAppendValue(string[] slice, string append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(string[]) autowrap_csharp_slice_StringAppendSlice(string[] slice, string[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(string[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(string[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        wstring[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(wstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringSlice(wstring[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        wstring[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(wstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring) autowrap_csharp_slice_WstringGet(wstring[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(wstring)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_WstringSet(wstring[] slice, size_t index, wstring set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringAppendValue(wstring[] slice, wstring append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(wstring[]) autowrap_csharp_slice_WstringAppendSlice(wstring[] slice, wstring[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(wstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(wstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        dstring[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(dstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringSlice(dstring[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        dstring[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(dstring[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring) autowrap_csharp_slice_DstringGet(dstring[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(dstring)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_DstringSet(dstring[] slice, size_t index, dstring set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringAppendValue(dstring[] slice, dstring append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(dstring[]) autowrap_csharp_slice_DstringAppendSlice(dstring[] slice, dstring[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(dstring[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(dstring[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        bool[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(bool[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolSlice(bool[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        bool[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(bool[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool) autowrap_csharp_slice_BoolGet(bool[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(bool)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_BoolSet(bool[] slice, size_t index, bool set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolAppendValue(bool[] slice, bool append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(bool[]) autowrap_csharp_slice_BoolAppendSlice(bool[] slice, bool[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(bool[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(bool[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        byte[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(byte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteSlice(byte[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        byte[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(byte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte) autowrap_csharp_slice_ByteGet(byte[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(byte)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_ByteSet(byte[] slice, size_t index, byte set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteAppendValue(byte[] slice, byte append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(byte[]) autowrap_csharp_slice_ByteAppendSlice(byte[] slice, byte[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(byte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(byte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ubyte[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ubyte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteSlice(ubyte[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ubyte[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ubyte[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte) autowrap_csharp_slice_UbyteGet(ubyte[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ubyte)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UbyteSet(ubyte[] slice, size_t index, ubyte set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteAppendValue(ubyte[] slice, ubyte append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(ubyte[]) autowrap_csharp_slice_UbyteAppendSlice(ubyte[] slice, ubyte[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ubyte[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ubyte[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        short[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(short[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortSlice(short[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        short[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(short[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short) autowrap_csharp_slice_ShortGet(short[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(short)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_ShortSet(short[] slice, size_t index, short set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortAppendValue(short[] slice, short append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(short[]) autowrap_csharp_slice_ShortAppendSlice(short[] slice, short[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(short[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(short[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ushort[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ushort[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortSlice(ushort[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ushort[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ushort[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort) autowrap_csharp_slice_UshortGet(ushort[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ushort)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UshortSet(ushort[] slice, size_t index, ushort set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortAppendValue(ushort[] slice, ushort append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(ushort[]) autowrap_csharp_slice_UshortAppendSlice(ushort[] slice, ushort[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ushort[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ushort[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        int[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(int[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntSlice(int[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        int[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(int[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int) autowrap_csharp_slice_IntGet(int[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(int)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_IntSet(int[] slice, size_t index, int set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntAppendValue(int[] slice, int append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(int[]) autowrap_csharp_slice_IntAppendSlice(int[] slice, int[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(int[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(int[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        uint[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(uint[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintSlice(uint[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        uint[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(uint[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint) autowrap_csharp_slice_UintGet(uint[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(uint)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UintSet(uint[] slice, size_t index, uint set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintAppendValue(uint[] slice, uint append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(uint[]) autowrap_csharp_slice_UintAppendSlice(uint[] slice, uint[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(uint[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(uint[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        long[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(long[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongSlice(long[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        long[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(long[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long) autowrap_csharp_slice_LongGet(long[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(long)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_LongSet(long[] slice, size_t index, long set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongAppendValue(long[] slice, long append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(long[]) autowrap_csharp_slice_LongAppendSlice(long[] slice, long[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(long[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(long[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ulong[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ulong[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongSlice(ulong[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        ulong[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(ulong[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong) autowrap_csharp_slice_UlongGet(ulong[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(ulong)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_UlongSet(ulong[] slice, size_t index, ulong set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongAppendValue(ulong[] slice, ulong append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(ulong[]) autowrap_csharp_slice_UlongAppendSlice(ulong[] slice, ulong[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(ulong[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(ulong[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        float[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(float[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatSlice(float[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        float[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(float[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float) autowrap_csharp_slice_FloatGet(float[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(float)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_FloatSet(float[] slice, size_t index, float set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatAppendValue(float[] slice, float append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(float[]) autowrap_csharp_slice_FloatAppendSlice(float[] slice, float[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(float[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(float[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleCreate(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        double[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(double[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleSlice(double[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        double[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(double[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double) autowrap_csharp_slice_DoubleGet(double[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double)(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(double)(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_DoubleSet(double[] slice, size_t index, double set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleAppendValue(double[] slice, double append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(double[]) autowrap_csharp_slice_DoubleAppendSlice(double[] slice, double[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(double[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(double[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)Create(size_t capacity) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        foo.Foo!(double)[] __temp__;
        __temp__.reserve(capacity);
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(foo.Foo!(double)[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)Slice(foo.Foo!(double)[] slice, size_t begin, size_t end) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        foo.Foo!(double)[] __temp__ = slice[begin..end];
        pinPointer(cast(void*)__temp__.ptr);
        return returnValue!(foo.Foo!(double)[])(__temp__);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)) autowrap_csharp_slice_Foo_Foo!(double)Get(foo.Foo!(double)[] slice, size_t index) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double))(slice[index]);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double))(__ex__);
    }
}
extern(C) export returnVoid autowrap_csharp_slice_Foo_Foo!(double)Set(foo.Foo!(double)[] slice, size_t index, foo.Foo!(double) set) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        slice[index] = set;
        return returnVoid();
    } catch (Exception __ex__) {
        return returnVoid(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)AppendValue(foo.Foo!(double)[] slice, foo.Foo!(double) append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double)[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)[]) autowrap_csharp_slice_Foo_Foo!(double)AppendSlice(foo.Foo!(double)[] slice, foo.Foo!(double)[] append) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double)[])(slice ~= append);
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double)[])(__ex__);
    }
}
extern(C) export returnValue!(foo.Foo!(double)) autowrap_csharp_FooMakeFooDouble(double x) nothrow {
    try {
        thread_attachThis();
        rt_moduleTlsCtor();
        scope(exit) rt_moduleTlsDtor();
        scope(exit) thread_detachThis();
        return returnValue!(foo.Foo!(double))(makeFooDouble(x));
    } catch (Exception __ex__) {
        return returnValue!(foo.Foo!(double))(__ex__);
    }
}

ddd

Error in autowrap.reflection.Functions template

I continue my efforts to wrap drepl. https://github.com/kaleidicassociates/pydrepl
@Laeeth was king enough to share https://github.com/kaleidicassociates/pydrepl, which I use now.
Unfortunately, I still get errors:

Running pre-build commands...
../../../.dub/packages/autowrap-master/autowrap/reflection/source/autowrap/reflection.d(45,23): Error: template autowrap.reflection.Functions does not match any template declaration
/usr/include/dmd/phobos/std/meta.d(779,37): Error: template instance autowrap.reflection.F!(Module("replwrap", cast(Flag)true)) error instantiating
../../../.dub/packages/autowrap-master/autowrap/reflection/source/autowrap/reflection.d(39,26):        instantiated from here: staticMap!(Functions, Module("replwrap", cast(Flag)true))
../../../.dub/packages/autowrap-master/autowrap/python/source/autowrap/python/wrap.d(22,31):        instantiated from here: AllFunctions!(Module("replwrap", cast(Flag)true))
source/app.d-mixin-2(9,13):        instantiated from here: wrapAllFunctions!(Module("replwrap", cast(Flag)true))
dmd failed with exit code 1.

Failed to wrap std.array.Appender!(char[])

Hi,

I am trying to wrap drepl using autowrap. More specifically, i'm trying to wrap an instance of this https://github.com/dlang-community/drepl/blob/master/src/drepl/interpreter.d#L151, something like

auto intp = interpreter(dmdEngine());

Actually, I managed to export the interpret method

export:
    auto intp(char[] txt) {
        return interpreter(dmdEngine()).interpret(txt);
    }

and tested it in ipython successfully.

But when I tried to export the whole dmdEngine

export:
   auto engine() {
           return interpreter(dmdEngine());
   }

it complained about copying Interpreter!(DMDEngine).Interpreter

../../../.dub/packages/pyd-master/pyd/infrastructure/pyd/make_object.d(249,30): Error: struct drepl.interpreter.Interpreter!(DMDEngine).Interpreter is not copyable because it is annotated with @disable

I removed @disable, but then complained about accessing the members _engine and _incomplete in Interpreter (https://github.com/dlang-community/drepl/blob/master/src/drepl/interpreter.d#L147-L148)

../../../.dub/packages/pyd-master/pyd/infrastructure/pyd/struct_wrap.d-mixin-56(56,15): Deprecation: std.array.Appender!(char[]).Appender._data is not visible from module ../../../.dub/packages/pyd-master/pyd/infrastructure/pyd/struct_wrap.d-mixin-56(56,15): Error: struct std.array.Appender!(char[]).Appender member _data is not accessible

After I made those public, it complained about Appender

../../../.dub/packages/pyd-master/pyd/infrastructure/pyd/struct_wrap.d-mixin-56(56,15): Deprecation: std.array.Appender!(char[]).Appender._data is not visible from module
> ../../../.dub/packages/pyd-master/pyd/infrastructure/pyd/struct_wrap.d-mixin-56(56,15): Error: struct std.array.Appender!(char[]).Appender member _data is not accessible

Is there something I can do here or would it make more sense to ask to the Drepl guys?

Thank you

problem building tests on master

dub test leads to

/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(59,20): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(60,20): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(61,20): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(66,25): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(67,25): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/any.d(68,25): Error: undefined identifier theGC
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/sdk/xll.d(43,6): Error: no property shouldEqual for type int
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/sdk/xll.d(51,30): Error: no property shouldEqual for type int
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/test/util.d(400,14): Error: no property shouldEqual for type int
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/test/util.d(401,14): Error: no property shouldEqual for type int
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(105,30): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(108,30): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(111,30): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(114,30): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(117,30): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(120,32): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/traits.d(124,32): Error: no property shouldEqual for type string
/home/laeeth/.dub/packages/excel-d-0.3.5/excel-d/source/xlld/wrap/wrap.d(509,19): Error: module d_funcs is in file 'test/d_funcs.d' which cannot be read

Nullable!T doesn't wrap

eg
skipping Nullable!(TDLine!(PriceBar!(PriceBarType(cast(PriceBarFlags)32u), -1, "Daily")))
skipping Nullable!(TDLine!(PriceBar!(PriceBarType(cast(PriceBarFlags)96u), -1, "Intraday")))
skipping Nullable!(KPDate!(cast(KPDateType)2, "Europe/London"))

don't wrap special methods/fields/functions

What's causing the difficulties with wrapping @disable this(this) structs and so on is that you try to wrap methods and/or fields that shouldn't be wrapped.

After making these fixes then it's fine to wrap a pointer to a disable this(this) struct. Although if a factory function returns it then it won't be wrapped automatically.

// must be a global template
private template isMemberFunction(A...) if(A.length == 1) {
        import std.string:startsWith;
    alias T = A[0];
    static if(__traits(compiles, __traits(identifier, T)))
        enum isMemberFunction = isPublicFunction!T && __traits(identifier, T) != "__ctor" && !__traits(identifier,T).startsWith("__field") && !__traits(identifier,T).startsWith("__aggr") && !__traits(identifier,T).startsWith("__postblit") && !__traits(identifier,T).startsWith("__dtor");
    else
        enum isMemberFunction = false;
}

Calling method on derived class via base pointer fails

This should work but doesn't:

class Base {
    this(int i) { }
    string foo() {
        return "Base.foo";
    }
    string bar() {
        return "Base.bar";
    }
}


class Derived : Base {
    this(int i) { super(i); }
    override string foo() {
        return "Derived.foo";
    }
}

Base return_poly_derived() {
    return new Derived(2);
}
assert return_poly_derived().foo() == 'Derived.foo'

pynih should allow you to call python functions from D

https://github.com/ariovistus/pyd/blob/master/infrastructure/pyd/embedded.d
The above is pyd code that enables this


;
--
  |  
  | /+
  | + Things we want to do:
  | +  * run python code in D (easily) [check]
  | +  * run D code in python [check]
  | +  * declare python functions and use them in D [check]
  | +  * access and manipulate python globals in D [check]
  | +  * wrap D classes/structs and use them in python or D [check]
  | +  * use python class instances in D [check]
  | +  * wrap D ranges and iterators or whatever and iterate through them in python [why?]
  | +  * wrap python iterators as D input ranges [check]
  | +  * do things with inheritance [why??!??]
  | +  * do things with multithreading
  | +/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.