Attribute transference from callbacks?

Zach Tollen notmyrealemail at whatever.eee
Tue Dec 10 22:36:34 UTC 2024


On Sunday, 8 December 2024 at 05:54:40 UTC, Manu wrote:
> We have a serious problem though; a function that receives a 
> sink function
> must transfer the attributes from the sink function to itself, 
> and we have
> no language to do that...
> What are the leading strategies that have been discussed to 
> date? Is there
> a general 'plan'?

This was brought up in a [thread][thread1] in DIP Ideas. I 
contributed my idiosyncratic thoughts here:

https://forum.dlang.org/post/rtvjsdyuqwmzwiggsolw@forum.dlang.org

Suggestion #2 in that post addresses the issue you raise. In 
short, I proposed that the language default to inheriting 
attributes for the enclosing function at the call site, and then 
suggested a (callable function/delegate) parameter keyword 
`@noimply` for those rare cases when you *don't* want the 
function to inherit the characteristics of the delegate that you 
pass. I tried to explain it in the post.

All my post did was suggest some hopefully elegant syntax for a 
number of attribute-related issues, of which this was one.

[thread1]: 
https://forum.dlang.org/thread/pfawiqhppkearetcrkno@forum.dlang.org


More information about the Digitalmars-d mailing list