proposal: @mixin functions to auto-mixin at call site

Timothee Cour thelastmammoth at gmail.com
Wed Sep 4 10:10:19 PDT 2013


frankly, UFCS mixin would make the use case in the OT bearable.

fun().mixin.writeln is ok
mixin(fun()).writeln is ugly (esp in more complex cases).

so, is there anything against it despite requiring one to implement it?


On Wed, Sep 4, 2013 at 8:29 AM, Dicebot <public at dicebot.lv> wrote:

> On Wednesday, 4 September 2013 at 15:18:10 UTC, Ary Borenszweig wrote:
>
>> So the problem is not that implicit mixin is unsafe. The problem is that
>> there's no way to declare a new variable that won't conflict with existing
>> variables in the current scope?
>>
>
> This is the same problem. The key property of mixin is that it is
> unhygienic and invades the caller scope. It is the only entity in D that is
> allowed to do it. Allowing implicit unhygienic inclusions is guaranteed to
> result in accidental symbol clash and/or unexpected modification sooner or
> later.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130904/0e6bb535/attachment.html>


More information about the Digitalmars-d mailing list