UFCS for D

Nick Sabalausky a at a.a
Thu Mar 29 19:38:34 PDT 2012


"Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
news:nidsvjszuhicjthlpaxm at forum.dlang.org...
> On Friday, 30 March 2012 at 01:55:23 UTC, Nick Sabalausky wrote:
>> <wishful musing>I've been starting to think
>> more and more that the "everything in a module is a friend" was a 
>> mistake,and that we should have instead just had a "module"
>> access specifier like we have "package".</wishful musing>
>
> Or, for moar compatibility, have enemy functions.
>
> class Klingon { private Starship commanding; }
> void nonFriend(enemy Klingon kor) {
>     kor.commanding = lol; // error, commanding is private and kor is an 
> enemy
> }
>

You forgot:

version(KhitomerAccords) {} else {
    [...]
}

'Course that still doesn't take into account that short period in the middle 
of DS9, but meh, good enough.

And then there's this line, which I'd consider mandatory for any 
Trek-related code:

version(JJAbrams)
    static assert(false, "Fuck this shit, this ain't even Star Trek 
anyway");

>
> Or, to avoid having a new keyword, call it interface
> instead of enemy.
>

Don't you mean "static"? ;)





More information about the Digitalmars-d-announce mailing list