D Language Quarterly Meeting Summary for January 2021
Mathias LANG
geod24 at gmail.com
Mon Jan 24 02:11:37 UTC 2022
On Friday, 21 January 2022 at 12:55:58 UTC, ag0aep6g wrote:
> On 21.01.22 13:33, Mike Parker wrote:
>> ### Mathias
>> Mathias would very much like to see the unification of
>> delegates and function pointers. There was general agreement
>> that this is a good goal to aim for. Mathias subsequently
>> informed me he will look into it once some other things are
>> off his TODO list if no one else gets to it first.
>
> I still believe it should be fairly simple:
>
> https://forum.dlang.org/post/ofc0lj$2u4h$1@digitalmars.com
Actually, the idea I had in mind is a little different.
Because a delegate is essentially:
```D
T function (T, Args..)(void* ctx, Args args)
```
It should be possible for the compiler to generate a call to a
trampoline function that just forwards to the actual function:
```D
RT _d_trampoline (FT, RT, Args..)(void* ctx, Args args)
{
return (cast(FT) ctx)(args);
}
```
More information about the Digitalmars-d-announce
mailing list