Things that make writing a clean binding system more difficult

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 28 21:52:02 PDT 2016


On Friday, July 29, 2016 06:44:16 Timon Gehr via Digitalmars-d wrote:
> My parser accepts the following:
>
> int function(int,int)ref functionPointer;
>
> I wasn't really aware that this was illegal in DMD. (Other function
> attributes, such as pure, are accepted.)
>
> In fact, even the following is disallowed:
> int foo(int)ref{}
>
>
> Should I file an enhancement request?

Except that ref isn't a function attribute. It's an attribute on the return
type. So, it doesn't make sense for it to be on the right. That would be
like having the const on the right-hand side of a member function apply to
the return type rather than the function itself.

- Jonathan M Davis



More information about the Digitalmars-d mailing list