A New Generation of Features for Programming Languages
Dare Obasanjo has an interesting post about programming language features, especially with regards to Cω. This does indeed seem rather smart:
Take the following class definition as an example:public class Buffer { public async Put(string s); public string Get() & Put(string s) { return s; } }In the Buffer class a call to the Put() method blocks until a corresponding call to a Get() method is made. Once this happens the parameters to the Put() method are treated as local variable declarations in the Get() method and then the code block runs. Similarly a call to a Get() method blocks until a corresponding Put() method is called. This assumes that each corresponding Put() call has a corresponding Get() call and vice versa.
FYI: Dare Obasanjo has changed (I assume corrected) the description of the way this class works.
Thanks for pointing it out …