Feedback Thread: DIP 1032--Function pointers and Delegate Parameters...--Community Review Round 1

Walter Bright newshound2 at digitalmars.com
Wed May 20 06:06:08 UTC 2020


On 4/3/2020 3:51 PM, Jonathan Marler wrote:
> I also want to point out that the "Breaking Changes and Deprecations" section is 
> incorrect.
> 
>     > It is possible that a parameter declaration may require that a delegate or 
> function pointer parameter have fewer attributes than the function itself. This 
> would only be possible if the delegate or function pointer was never called, but 
> was ignored or simply stored elsewhere.
> 
> It's possible that you want the function or delegate pointer to have fewer 
> attributes even when you are calling it.
> 
> In my other comment I gave the "nothrow" example, where the function itself is 
> nothrow but the function/delegate points can throw.  So I wanted to make sure 
> that this use case is also addressed in this section.

You are correct.


> Another use case off the top of my head is "pure".  You could be a pure function 
> yourself, and call non-pure function/delegate pointers so long as they are 
> inside debug blocks.

Yes again.


More information about the Digitalmars-d mailing list