Feedback Thread: DIP 1032--Function pointers and Delegate Parameters...--Community Review Round 1
Jonathan Marler
johnnymarler at gmail.com
Fri Apr 3 22:39:48 UTC 2020
On Friday, 3 April 2020 at 10:31:12 UTC, Mike Parker wrote:
> This is the feedback thread for the first round of Communnity
> Review of DIP 1032, "Function pointers and Delegate Parameters
> Inherit Attributes from Function".
>
> ===================================
> **THIS IS NOT A DISCUSSION THREAD**
>
> Posts in this thread must adhere to the feedback thread rules
> outlined in the Reviewer Guidelines (and listed at the bottom
> of this post).
>
> https://github.com/dlang/DIPs/blob/master/docs/guidelines-reviewers.md
>
> That document also provides guidelines on contributing feedback
> to a DIP review. Please read it before posting here. If you
> would like to discuss this DIP, please do so in the discussion
> thread:
>
> https://forum.dlang.org/post/ovllntpiebixbtrbiuxj@forum.dlang.org
>
> ==================================
>
> You can find DIP 1032 here:
>
> https://github.com/dlang/DIPs/blob/0c99bd854302ade3e6833080410e9050fddec346/DIPs/DIP1032.md
>
> The review period will end at 11:59 PM ET on April 17, or when
> I make a post declaring it complete. Feedback posted to this
> thread after that point may be ignored.
>
> At the end of this review round, the DIP will be moved into the
> Post-Community Round 1 state. Significant revisions resulting
> from this review round may cause the DIP manager to require
> another round of Community Review, otherwise the DIP will be
> queued for the Final Review.
>
> ==================================
> Posts in this thread that do not adhere to the following rules
> will be deleted at the DIP author's discretion:
>
> * All posts must be a direct reply to the DIP manager's initial
> post, with only two exceptions:
>
> - Any commenter may reply to their own posts to retract
> feedback contained in the original post
>
> - The DIP author may (and is encouraged to) reply to any
> feedback solely to acknowledge the feedback with agreement or
> disagreement (preferably with supporting reasons in the latter
> case)
>
> * Feedback must be actionable, i.e., there must be some action
> the DIP author can choose to take in response to the feedback,
> such as changing details, adding new information, or even
> retracting the proposal.
>
> * Feedback related to the merits of the proposal rather than to
> the contents of the DIP (e.g., "I'm against this DIP.") is
> allowed in Community Review (not Final Review), but must be
> backed by supporting arguments (e.g., "I'm against this DIP
> because..."). The supporting arguments must be reasonable.
> Obviously frivolous arguments waste everyone's time.
>
> * Feedback should be clear and concise, preferably listed as
> bullet points (those who take the time to do an in-depth review
> and provide feedback in the form of answers to the questions in
> this document will receive much gratitude). Information
> irrelevant to the DIP or is not provided in service of
> clarifying the feedback is unwelcome.
Instead of delegate/function pointer parameters implicitly
inheriting all the attributes of the containing function, what if
we made it "opt-in" with a single attribute? i.e.
@safe pure nothrow @nogc
int foo(int delegate() @inherit dg, int function() @inherit fp)
{
return dg() + fp();
}
Advantages:
1. No code breakage
2. The developer sees @inherit and knows the function/delegate
pointer it will contain extra attributes inherited from somewhere
else.
3. You can still support the case where you don't want any
attributes. Example cases of this would be if you're not calling
the pointer yourself, or, maybe the function itself is nothrow
but it allows the function/delegate pointers to throw and
catches/handles their exceptions without propogating them.
More information about the Digitalmars-d
mailing list