Explcit impure function attribute

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Jun 26 17:51:46 UTC 2024


On 27/06/2024 5:35 AM, Quirin Schroll wrote:
> On Monday, 24 June 2024 at 16:47:06 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> On 25/06/2024 4:38 AM, Quirin Schroll wrote:
>>> Make `@impure` a compiler-recognized AtAttribute. This has the 
>>> downside of being asymmetric: `pure` has no `@`, but its inverse 
>>> `@impure` would have it.
>>
>> So add it.
>>
>> Deprecate, then remove without ``@`` in newer editions.
> 
> So, you favor (effectively) adding `@impure`, and adding `@pure` as an 
> alias for `pure`, while deprecating `pure`. Did I understand that 
> correctly?

Yes.

Get all the attributes to be the same, clean it up!

>> Making all attributes consistent with using ``@`` is a good thing.
> 
> There are still `throw` and `nothrow`. If I had to lay a bet on it, I’d 
> say they don’t go anywhere. The value of replacing _them_ with something 
> with `@` is negligible.

They'll both be going away at some point in favor of a throws set, to 
allow for value type exceptions.

No other way to get the sumtype style exceptions working and there is 
significant desire by core developers for it.


More information about the dip.ideas mailing list