On Monday, 24 April 2017 at 21:59:34 UTC, Atila Neves wrote:
Now with more `@nogc`. Before, this worked fine:

double func(double d) @nogc nothrow { return d * 2; }

The function is `@nogc`, the wrapper function (i.e. the function that Excel actually calls) is also `@nogc` via the magic of compile-time reflection. So far, so good. But what if you want to return a string or an array back to Excel. Oh, oh...

Enter the `@Dispose` UDA:

And Bob's your uncle.

Atila

Very nice.
On reddit here since it's a pretty nice example of how you don't need to use dark magic to write code in D without depending on the GC:
https://www.reddit.com/r/programming/comments/67dogy/writing_excel_addins_in_d_without_using_the/

Reply via email to