On Sun, Aug 2, 2009 at 4:21 PM, Nick Sabalausky<[email protected]> wrote: > "Oliver Hoog" <[email protected]> wrote in message > news:[email protected]... >> >> But you would have to write more than necessary. Simpler is: >> --- >> bool foo { >> in(bar) { ... } >> out { return ... } >> } >> --- >> in is translated to: void in(bool bar) {...} >> out is translated to: bool out() {...} >> >> To get a delegate to in: >> auto f = &foo.in; >> >> foo = 5; is equivalent to foo.in(5); >> >> This way you don't need any new keywords or ugly (double) underscores. >> And it's unambiguous and pretty clear. > > Yes! Or wait, even better yet: > > static foo { > static(static) { ... } > static static { static ... } > } > > In fact, let's *really* minimize the number of keywords in D: > > // From: > int main(char[][] args) > { > if(args.length == 1) > return 1; > > return 0; > } > > // To: > static static(static[][] static) > { > static(static.static== 1) > static 1; > > static 0; > } > > Perfect! Now we'll never have to worry about having too many keywords!
'static' is a woefully underused keyword. It really does need more uses.
