Thread overview | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 19, 2017 UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Apparently user-defined attributes are not permitted on enum members. Issue is documented here: https://issues.dlang.org/show_bug.cgi?id=9701 Pull request implementing the feature is here: https://github.com/dlang/dmd/pull/6161 The pull request seems to have stalled over how to get the feature approved. Some consider it an oversight in the implementation of UDAs. Others consider it a language change. What's the official word? Does it require a DIP? Thanks, Mike |
November 19, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On Sunday, November 19, 2017 13:35:13 Michael V. Franklin via Digitalmars-d wrote: > Apparently user-defined attributes are not permitted on enum members. > > Issue is documented here: > https://issues.dlang.org/show_bug.cgi?id=9701 > Pull request implementing the feature is here: > https://github.com/dlang/dmd/pull/6161 > > The pull request seems to have stalled over how to get the feature approved. Some consider it an oversight in the implementation of UDAs. Others consider it a language change. What's the official word? Does it require a DIP? It isn't specific to UDAs. You can't put _any_ attributes on enums - including something like deprecated (though to be fair, not many attributes would make sense on an enum member). https://issues.dlang.org/show_bug.cgi?id=9395 - Jonathan M Davis |
November 19, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On Sunday, 19 November 2017 at 13:35:13 UTC, Michael V. Franklin wrote:
> Apparently user-defined attributes are not permitted on enum members.
>
> Issue is documented here: https://issues.dlang.org/show_bug.cgi?id=9701
> Pull request implementing the feature is here: https://github.com/dlang/dmd/pull/6161
>
> The pull request seems to have stalled over how to get the feature approved. Some consider it an oversight in the implementation of UDAs. Others consider it a language change. What's the official word? Does it require a DIP?
>
> Thanks,
> Mike
I remember Johan Engelen doing something about this, can't remember if it was LDC or DMD.
|
November 20, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Sunday, 19 November 2017 at 15:57:58 UTC, Jonathan M Davis wrote: > It isn't specific to UDAs. You can't put _any_ attributes on enums - including something like deprecated (though to be fair, not many attributes would make sense on an enum member). > > https://issues.dlang.org/show_bug.cgi?id=9395 Indeed. That precise use case showed up recently in this PR: https://github.com/dlang/dmd/pull/7303/files Mike |
November 27, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On Sunday, 19 November 2017 at 13:35:13 UTC, Michael V. Franklin wrote:
> Apparently user-defined attributes are not permitted on enum members.
>
> Issue is documented here: https://issues.dlang.org/show_bug.cgi?id=9701
> Pull request implementing the feature is here: https://github.com/dlang/dmd/pull/6161
>
> The pull request seems to have stalled over how to get the feature approved. Some consider it an oversight in the implementation of UDAs. Others consider it a language change. What's the official word? Does it require a DIP?
Bumping this thread. I'm still hoping for an official answer to this.
Walter and/or Andrei,
Is the lack of support for attributes on `enum` members an implementation oversight?
Is a DIP required to move the implementation forward?
Thanks,
Mike
|
November 27, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On 11/27/2017 05:43 AM, Michael V. Franklin wrote:
> On Sunday, 19 November 2017 at 13:35:13 UTC, Michael V. Franklin wrote:
>> Apparently user-defined attributes are not permitted on enum members.
>>
>> Issue is documented here: https://issues.dlang.org/show_bug.cgi?id=9701
>> Pull request implementing the feature is here: https://github.com/dlang/dmd/pull/6161
>>
>> The pull request seems to have stalled over how to get the feature approved. Some consider it an oversight in the implementation of UDAs. Others consider it a language change. What's the official word? Does it require a DIP?
>
> Bumping this thread. I'm still hoping for an official answer to this.
>
> Walter and/or Andrei,
>
> Is the lack of support for attributes on `enum` members an implementation oversight?
>
> Is a DIP required to move the implementation forward?
>
> Thanks,
> Mike
>
Hi Mike, this forum is not an appropriate place for requesting official answers. We don't scan the forums looking for matters that need attention. Feel free to send email to Walter and myself, and that will get answered. Thanks! -- Andrei
|
November 28, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Monday, 27 November 2017 at 17:48:35 UTC, Andrei Alexandrescu wrote: > Hi Mike, this forum is not an appropriate place for requesting official answers. We don't scan the forums looking for matters that need attention. Feel free to send email to Walter and myself, and that will get answered. Thanks! -- Andrei Someone seems to disagree with you in that regard. https://forum.dlang.org/post/ouqgln$1chr$1@digitalmars.com Not only did it get your attention but you didn't even bother addressing it! |
November 27, 2017 Re: UDAs on Enum Members: Does it require a DIP? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John | On Tuesday, November 28, 2017 00:15:24 John via Digitalmars-d wrote:
> On Monday, 27 November 2017 at 17:48:35 UTC, Andrei Alexandrescu
>
> wrote:
> > Hi Mike, this forum is not an appropriate place for requesting official answers. We don't scan the forums looking for matters that need attention. Feel free to send email to Walter and myself, and that will get answered. Thanks! -- Andrei
>
> Someone seems to disagree with you in that regard. https://forum.dlang.org/post/ouqgln$1chr$1@digitalmars.com
>
> Not only did it get your attention but you didn't even bother addressing it!
There is a definite difference between posting stuff in the newsgroup to get attention brought to something and posting in the newsgroup to get an official answer on something from Walter or Andrei.
- Jonathan M Davis
|
November 28, 2017 Attributes on Enum Members: Call for use cases. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On Sunday, 19 November 2017 at 13:35:13 UTC, Michael V. Franklin wrote:
> What's the official word? Does it require a DIP?
For those who might want to know, Walter has informed me that this change will require a DIP. I already have two DIPs in the queue right now, so I wouldn't mind if someone else wrote it.
But, absent any volunteers, I would welcome all of you to reply to this thread with some use cases where you might find UDAs or other attributes useful on enum members. Deprecation and serialization have already been mentioned, but it'd be impossible for me to imagine all the different ways users might find this feature useful.
Thanks,
Mike
|
November 28, 2017 Re: Attributes on Enum Members: Call for use cases. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael V. Franklin | On 2017-11-28 03:20, Michael V. Franklin wrote: > For those who might want to know, Walter has informed me that this change will require a DIP. That's unfortunate. It should be the opposite, a DIP on why enum members should not support attributes. It goes against consistency (turtles all the way down). -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation