std.compress

Daniel Murphy yebblies at nospamgmail.com
Sun Jun 9 18:44:56 PDT 2013


"Timothee Cour" <thelastmammoth at gmail.com> wrote in message 
news:mailman.999.1370827257.13711.digitalmars-d at puremagic.com...
>
> 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/mailman.1453.1369099708.4724.digitalmars-d@puremagic.com
>

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. 




More information about the Digitalmars-d mailing list