JavaScript has Immediately invoked function expressions, they look like this : (function(){})();
I was wondering if something similar could be achieved in D. Failing that, a bonus question would be : Can I achieve the 'Revealing Module' design pattern in Dlang, or is this exclusive to JavaScript ?
I tried using pretty much the JS syntax.
import std.stdio;
void main()
{
(function(){
return "hello";
})();
}
I got no result, but it seemed to compile fine in the online code playground I used.