support UFCS with fully qualified function names (was in "digitalmars.D.learn")

bearophile bearophileHUGS at lycos.com
Tue May 21 00:09:15 PDT 2013


Kenji Hara:

> If you need to use fully qualified name, you can use normal 
> function call syntax.
>
>     auto a = std.path.join("", "\n");

I'm sure Timothee is aware of your solution, but it breaks UFCS 
chains or doesn't allow them.

So if you want to write:

foo.bar.baz.spam.red;

But you have to fully qualify baz, currently you have to write:

spam(std.somemodule.baz(foo.bar)).red;

Or more naturally:

auto aux = std.somemodule.baz(foo.bar);
aux.spam.red;

With Timothee idea you write something like:

foo.bar.(std.somemodule.baz).spam.red;

This looks like a small improvement.

(Elsewhere I have even suggested to optionally use typeof and 
assert with a dot-leading syntax, like sizeof).

Bye,
bearophile


More information about the Digitalmars-d mailing list