Attribute transference from callbacks?

Timon Gehr timon.gehr at gmx.ch
Tue Dec 10 22:10:01 UTC 2024


On 12/9/24 08:00, Araq wrote:
> On Monday, 9 December 2024 at 06:47:26 UTC, Manu wrote:
>>
>> Right. Do you have examples of this from other languages and how it's 
>> expressed? Lifetime's in Rust are the obvious benchmark, but I don't 
>> see any evidence that D has a taste for this sort of thing.
> 
> 
> Nim uses an `effectsOf` annotation, see https://nim-lang.org/docs/ 
> manual.html#effect-system-effectsof-annotation
> ...

Does this only work if the callback is directly a parameter?

> That said, IME effect systems are not worth it and the complexity budget 
> is better spent elsewhere.

Well, I think given that we do any kind of parametric polymorphism, 
effect polymorphism is not a big leap anymore.

But sure, another way to get out of this conundrum would be to remove 
the function effect annotations completely, though I think some people 
are getting some mileage out of them and would like to be able to use 
them properly with callbacks instead.


More information about the Digitalmars-d mailing list