On Sunday, 6 February 2022 at 15:17:35 UTC, Paul Backus wrote:
On Sunday, 6 February 2022 at 14:44:40 UTC, Ola Fosheim Grøstad wrote:
On Sunday, 6 February 2022 at 13:33:53 UTC, Paul Backus wrote:

@mustUse is a user-defined attribute, and the official style guide says that names of UDAs should be camelCased:

It is kinda confusing to call it a user-defined attribute if it is recognized by the compiler.

Compiler-recognized UDAs are an established feature of D. See [`core.attribute`][1] for more examples.

I dislike the camel case as well, and the name is less clear than "nodiscard" in my opinion.

I suppose you'll have to take that up with Walter, since he's the one who vetoed "nodiscard".

To be honest, though, I can see where he's coming from. When writing DIP 1038, I made a conscious effort to avoid using the term "non-`@nodiscard`", due to the double negative. With a positively-phrased name like `@mustUse`, that problem disappears.

[1]: https://druntime.dpldocs.info/core.attribute.html

@hold (or @held) ? donwannaopenacanofworms ... my last post really :-P

(btw, It's a great companion for sumtype! thank you again!)




  • Re: DIP 1038--"@mustU... Daniel N via Digitalmars-d-announce
    • Re: DIP 1038--"@... Paul Backus via Digitalmars-d-announce
      • Re: DIP 1038--&qu... Paolo Invernizzi via Digitalmars-d-announce
        • Re: DIP 1038-... Paul Backus via Digitalmars-d-announce
          • Re: DIP 1... Paolo Invernizzi via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
            • Re: ... Paolo Invernizzi via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
      • Re: DIP 1038--&qu... Ola Fosheim Grøstad via Digitalmars-d-announce
        • Re: DIP 1038-... Paul Backus via Digitalmars-d-announce
          • Re: DIP 1... Paolo Invernizzi via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
          • Re: DIP 1... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Paul Backus via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce

Reply via email to