Clay language

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Dec 31 09:09:04 PST 2010


On 12/31/10 9:47 AM, Steven Schveighoffer wrote:
> On Fri, 31 Dec 2010 10:35:19 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> On 12/31/10 9:32 AM, Andrei Alexandrescu wrote:
>>> On 12/31/10 7:30 AM, "Jérôme M. Berger" wrote:
>>>> Andrei Alexandrescu wrote:
>>>>> And I stand by that claim. One aspect that seems to have been
>>>>> forgotten
>>>>> is that types usually implement either op= in terms of op or vice
>>>>> versa.
>>>>> That savings alone is large.
>>>>>
>>>> This could have been done with a couple of stdlib mixins
>>>> "generateOpsFromOpAssign" and "generateOpAssignsFromOp".
>>>
>>> The language definition would have stayed just as large.
>>>
>>> Andrei
>>
>> Besides, I feel a double standard here. Why are mixins bad for
>> simplifying certain rarely-needed boilerplate, yet are just fine when
>> they supplant a poor design?
>
> Requiring mixins in any case looks like a poor design to me. Any time
> mixins are the answer, it raises significantly the bar for understanding
> not only how to write the code, but how to use it as well. Mixins are
> great for low-level things that can be abstracted away, but to make them
> part of your interface looks to me like we're back to C macros. Anyone
> trying to follow the code is going to have to jump through quite a few
> hoops to understand it.
>
> I think the point of Jerome is that the uncommon case of wanting to
> specify multiple operators with one template

I thought I have clearly shown that that is the _common_ case.

Andrei


More information about the Digitalmars-d mailing list