Should the comma operator be removed in D2?

Justin Johansson no at spam.com
Wed Nov 18 05:11:06 PST 2009


yigal chripun wrote:
> You're remark of function chaining reminded me of a nice feture that a few OOP languages provide:
> 
> // pseudo syntax
> auto obj = new Object();
> obj foo() ; bar() ; goo() 
> 
> foo, bar and goo above are three mesages (methods) that are sent to the same object. i.e. it's the same as doing:
> obj.foo();
> obj.bar();
> obj.goo();
> 
> this means the functions can return void instead of returning this like you'd do in C++/D. I think it provides a cleaner conceptual separation between multiple messages sent to one object and real chaining when foo returns obj2 which then receives message bar and so on.

This has to be flame-bait for sure! :-)




More information about the Digitalmars-d mailing list