"Timothee Cour" <[email protected]> wrote in message 
news:[email protected]...
>
> which is why I have suggested supporting UFCS with fully qualified 
> function
> names:
>
> auto a="".(std.path.join)("\n");
> myfile.(std.file.write)(text);
> text.(std.stdio.write);
>
> see post: support UFCS with fully qualified function names (was in
> "digitalmars.D.learn")
> http://forum.dlang.org/post/[email protected]
>

I'm not a huge fan of this syntax.  If we were adding syntax, I would prefer 
a new operator with lower precedence than '.'

eg
auto a = "" -> std.path.join("\n");

But I'm not sure the problem is big enough to warrant new syntax.

> it also helps searchability: if one uses local aliases such as import
> std.stdio:write2=write, naive searching via grep 'write(' will miss such
> cases. The increase in complexity is minimal, and the feature makes sense
> with the rest of the language.
>

I agree, renamed imports make code harder to understand, and harder to 
refactor.

In this case we can prevent problem simply by not giving functions generic 
names like 'compress'.  Ideally you should be able to import the entire 
standard library with no name conflicts. 


Reply via email to