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

Walter Bright newshound2 at digitalmars.com
Wed Jul 29 01:21:44 UTC 2020


On 7/28/2020 4:00 PM, H. S. Teoh wrote:
> This is a misunderstanding of what was proposed.  What was proposed is
> that the compiler will treat such a call as if it were no longer pure
> (@safe, nothrow, etc.). I.e., if the caller was marked pure, this would
> trigger a compile error that it cannot call an impure function.  If the
> caller was impure to begin with, then it doesn't matter anyway.

Thanks for the clarification.

But it still tricks the user into thinking the function is pure, since it says 
right there it is pure. Pure isn't just an attribute for the compiler, it's for 
the user as it offers a guarantee about what the interface to a function is.

Silently removing pure can also make the user think that a function is 
thread-safe when it is not.

Adding a feature that silently disables an explicitly placed "pure" attribute is 
going to become a hated misfeature.

I strongly oppose it.


More information about the Digitalmars-d mailing list