"static" UFCS
Artur Skawina
art.08.09 at gmail.com
Thu Jun 14 08:41:13 PDT 2012
On 06/14/12 16:19, Jacob Carlborg wrote:
> On 2012-06-14 14:33, deadalnix wrote:
>
>> I already think that static method was a bad idea from the « everything
>> have to be an object » time.
>>
>> The need for static function is pretty weak when we have free function
>> and that they can access private objects data as needed.
>>
>> What would be the use case for such a feature ?
>
> Originally the idea pop up in my head when I was thinking if it was possible to implement, in library code, the magic meta namespace the community has been talking about a couple of times in the past.
>
> Something like this:
>
> import std.meta;
>
> class Foo
> {
> void bar (){}
> }
>
> auto methods = Foo.meta.methods;
Polluting local namespaces with magic identifiers is a really bad idea.
What's wrong with "auto methods = meta!Foo.methods;" which works right now?
artur
More information about the Digitalmars-d
mailing list