www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - support UFCS with fully qualified function names

reply Timothee Cour <thelastmammoth gmail.com> writes:
I'd like to be able to use UFCS with fully qualified function names.

A typical use case is to disambiguate , as in the following case:

 import std.path;
import std.string;
void main(){
    //Error: std.path.join()(const(char)[] p1, const(char)[] p2, const(char[
])[] more...) at ... conflicts with std.string.join at ...
    auto a="".join("\n");
    //what I'd like to have:
    auto a="".(std.path.join)("\n");
}

note: the fact that std.path.join!().join is deprecated is irrelevant to
this discussion.

Any chance this could be supported?

benefits:
avoids breaking UFCS chains
May 20 2013
next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Timothee Cour:

 I'd like to be able to use UFCS with fully qualified function 
 names.
     auto a="".(std.path.join)("\n");
It seems an acceptably-looking syntax. But maybe D.learn is not the best place to discuss new D syntax. Regarding new UFCS-related syntax, I sometimes wish for: alias T = foo.typeof; byBoolVal.assert; http://d.puremagic.com/issues/show_bug.cgi?id=4272 Bye, bearophile
May 20 2013
prev sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Timothee Cour:

     auto a="".(std.path.join)("\n");
I suggest to present it in the main D newsgroup. And if people don't hate it, to later write an enhancement request in bugzilla. Bye, bearophile
May 20 2013