Vision for the D language - stabilizing complexity?
ag0aep6g via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jul 12 04:12:41 PDT 2016
On 07/12/2016 12:55 PM, Shachar Shemesh wrote:
> On 12/07/16 13:25, Walter Bright wrote:
>> On 7/12/2016 12:35 AM, Shachar Shemesh wrote:
[...]
>>> struct A {
>>> void method() {}
>>> }
>>>
>>> void main() {
>>> A* a;
>>>
>>> a.method(); // Okay
>>> method(a); // Not okay
>>> }
>>
>> I'm afraid I don't know what you're driving at with those examples.
>>
>
> It is a single example. It shows that when UCFS and the lack of operator
> -> try to play together, the result is no longer as simple and elegant
> as one tries to sell them. It was given as a response to Andrei's
> request for examples of cross-features interference causing complexity.
There is no UFCS in that example, and the -> operator would only affect
the "Okay" case.
The "Not okay" case fails because there is no free function "method". It
would fail even if D didn't have UFCS and if it had the -> operator.
More information about the Digitalmars-d
mailing list