The review of std.hash package

Martin Nowak dawg at dawgfoto.de
Wed Aug 8 12:14:12 PDT 2012


--------
Hash hash;

void onData(void[] data)
{
     hash.put(data);
}

void main()
{
     hash.start();
     auto stream = new EventTcpStream("localhost", 80);
     stream.onData = &onData;
     hash.finish();
}
--------

> Have the callback supply a range interface to call the hash with.

That hardly works for event based programming without using coroutines.
It's the classical inversion-of-control dilemma of event based programming  
that forces you to save/restore your state with every event.


More information about the Digitalmars-d mailing list