On 2012-04-29 20:29, Sönke Ludwig wrote:

You just don't have to care about how to parse command line arguments,
how to initialize the library and to start the event loop.

Right, didn't thought of that. Would it be a good idea to allow top level code and use "import" and mixin the code in some context, i.e. :

// foo.d

auto settings = new HttpServerSettings;
settings.port = 8080;
listenHttp(settings, &handleRequest);

Then somewhere:

// vibe.d

void main (string[] args)
{
    handleCommandLine(args);
    init();
    mixin(import("foo.d"));
}

--
/Jacob Carlborg

Reply via email to