On Sunday, 27 May 2018 at 13:20:08 UTC, Adam D. Ruppe wrote:
On Sunday, 27 May 2018 at 06:47:38 UTC, IntegratedDimensions
wrote:
Putting the code in a template/function/lambda does not work
because of the scopes which will be called when the main
function exists.
I think you might just be
On Sunday, 27 May 2018 at 06:47:38 UTC, IntegratedDimensions
wrote:
Putting the code in a template/function/lambda does not work
because of the scopes which will be called when the main
function exists.
I think you might just be using the wrong kind of function.
---
import std.stdio;
// the
On Sunday, 27 May 2018 at 06:47:38 UTC, IntegratedDimensions
wrote:
A string mixin is too messy since it treats the code as a
string losing all syntax highlighting, etc.
I'd love to have something like a template mixin where I can
just do
mixin template fooSetup(ret)
{
// setup stuff
I guess I should have mentioned that basically this is like a C
macro.
I have some code like
void foo()
{
// setup stuff
int x;
scope(exit) something;
//
x = 34;
}
void foon()
{
// setup stuff
int x;
scope(exit) something;
//
}
All the setup stuff is virtually identical in each foo. There are
slight differences such