Dne čt 12. 1. 2023 12:51 uživatel Mike Parker > ... > Next, Razvan reported he had been looking at a PR to implement > the `throw` attribute for functions. The problem with it was that > it potentially breaks code that uses the `getAttributes` trait > when testing for the presence of `nothrow`. Walter said that the > compiler internally should just view `throw` as the absence of > `nothrow` rather than as a separate attribute. Its only purpose > is to turn `nothrow` off, so ideally code using `getAttributes` > shouldn't need to change at all. It's not like > `@safe`/`@trusted`/`@system`, which is a tri-state. With the > binary `nothrow`/`throw` state, you only need to care if a > function is `nothrow` or not. Martin agreed. > > With that, Andrei brought up past debates about `attribute(true)` > and `attribute(false)`. Walter finds that syntax clunky. It was > easy to use `throw` to turn off `nothrow` since it's already a > keyword. Petar brought up `pure` and `@nogc`. This led to a long > discussion about attribute algebra, attribute soup, negative and > positive attributes for disabling each other, attribute > inference, circular dependencies, and tangential topics. Finally, > Dennis gave his perspective and mentioned another proposal that > had come up in the past: using the `default` keyword to establish > a default set of attributes for non-templated, unannotated > functions, which could be used to "reset" the attribute state of > any function. Walter thought that `default` to reset state is a > great idea, and that we should think about that before
https://wiki.dlang.org/DIP79
