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