On 12/14/10, Vladimir Panteleev <vladi...@thecybershadow.net> wrote: > > if (resource == "/getfoo") > { > struct FooResult { int n; string s; } > return toJSON(FooResult(42, "bar")); // {"n":42,"s":"bar"} > }
Funny thing about that commented out code. I've tried returning something like that once from a function: return { int n = 42; string s = "bar"; } So basically a struct that has it's members default-initialized with some values. Unfortunately D thought I was returning a delegate instead, so I can't use this syntax.