Function pointers/delegates default args were stealth removed?

foobar foo at bar.com
Mon Aug 27 10:46:57 PDT 2012


On Monday, 27 August 2012 at 14:53:24 UTC, Andrei Alexandrescu 
wrote:
> On 8/27/12 7:34 AM, Manu wrote:
>> On 27 August 2012 17:03, foobar <foo at bar.com 
>> <mailto:foo at bar.com>> wrote:
>>
>>    This discussion is all sorts of wrong. Whoever said that 
>> defargs are
>>    metadata (Manu?) was right. Therefore it would make sense to
>>    implement a general metadata facility for D and use *that* 
>> for
>>    defargs. C++11 has annotations, so that's the place to 
>> start looking
>>    at. D has already enough of those pesky special case 
>> features, let's
>>    not add yet another one at the expense of a more general
>>    metadata/annotation mechanism which eventually would be 
>> added anyway
>>    due to popular demand.
>>
>>
>> Yes, I suggested this as a possibility above, but nobody 
>> commented. It
>> seems like it might solve 2 problems with one stone ;)
>
> Whilst I agree a metadata facility is an interesting topic to 
> look into, I think default arguments for functions is a poor 
> motivating example.
>
> Andrei

The point was that there are _other_ motivating examples for 
annotations hence there's already popular demand for it. Which is 
why it's worth the added complexity to the language. In fact part 
of that complexity *already* exists in D syntax via built-in 
annotations (e.g @safe).
This same feature (annotations) can be leveraged to solve this 
small corner case hence it shouldn't be implemented separately 
and complicate both D and DMD for little gain.



More information about the Digitalmars-d mailing list