Function pointers/delegates default args were stealth removed?

Manu turkeyman at gmail.com
Mon Aug 27 00:54:00 PDT 2012


On 27 August 2012 07:52, Walter Bright <newshound2 at digitalmars.com> wrote:

> On 8/26/2012 9:25 PM, Chris Cain wrote:
>
>> On Monday, 27 August 2012 at 04:01:10 UTC, Walter Bright wrote:
>>
>>> What happens with the name mangling? What about overloading? template
>>> type
>>> deduction? type specialization? type equivalence? type covariance?
>>>
>>
>> Name mangling: Without knowing enough about compiler making, I'm not sure
>> why it
>> matters. I couldn't answer, sorry.
>>
>
> The mangled names have a 1:1 correspondence with types. A mangled name
> can, for example, be reversed into a type.
>
> If default args form part of the type, then they'll have to be mangled in,
> too. This causes a rather long list of substantial problems.
>

This sounds like an implementation detail/dmd quirk is defining the
language spec...
I generally agree with the usage proposal above, it should be metadata that
doesn't affect type equivalence (although I'd probably expect is(f1 ==
f2def) should be true rather than false).
If that info needs to be mangled into the name to reproduce the type later,
fine, is that a problem? Perhaps stick it at the end of the mangled name in
a new metadata suffix that is truncated prior to any comparisons for
equality?

This actually rather relates to the attribute/annotation
proposals/conversations we were having some time back. If this is
addressed, then it may enable attributes too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120827/98cb2e6a/attachment-0001.html>


More information about the Digitalmars-d mailing list