proposal: @mixin functions to auto-mixin at call site
Timothee Cour
thelastmammoth at gmail.com
Tue Sep 3 14:27:57 PDT 2013
the other part of my post was about UFCS syntax for mixin:
eg: foo.mixin.writeln
is there any reason not to allow it?
On Tue, Sep 3, 2013 at 1:47 PM, Andrej Mitrovic
<andrej.mitrovich at gmail.com>wrote:
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130903/074e395c/attachment.html>
More information about the Digitalmars-d
mailing list