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

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Sep 3 13:47:36 PDT 2013


On 9/3/13, Jacob Carlborg <doob at me.com> wrote:
> With properties you never know if you're invoking a method or accessing
> a field:
>
> foo.data; // call method or access field?

Yeah but it does something with data on its own side. If this becomes
an implicit mixin, it could do something with code at the call site.
E.g.

auto st = getSecurityToken(...);
updateGui();  // what if this becomes a mixin and ends up reading 'st'
and displaying it on the screen?

It is equivalent to using globals everywhere in your codebase.


More information about the Digitalmars-d mailing list