Three Unlikely Successful Features of D

Don nospam at nospam.com
Wed Mar 21 13:00:17 PDT 2012


On 21.03.2012 18:14, Walter Bright wrote:
> On 3/21/2012 8:21 AM, Don Clugston wrote:
>> On 21/03/12 03:47, Walter Bright wrote:
>>> And now x is an instance of a voldemort type! It's completely
>>> encapsulated.
>>
>> That idiom is already built into the language. Anonymous nested
>> classes don't
>> have a name at all.
>>
>> auto x = new class { ... }
>>
>
> True, but it's the ability to return them from a function that's new &
> cool!
>
> (Yes, I know you can return x as type "Object".)

BTW what is 'nested' about anonymous nested classes? They seem to work 
anywhere! Can we just drop that from the name?



More information about the Digitalmars-d mailing list