January 26, 2019 [Issue 19619] New: Temporary solution for attribute extensibility problem | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19619 Issue ID: 19619 Summary: Temporary solution for attribute extensibility problem Product: D Version: D2 Hardware: All URL: https://forum.dlang.org/thread/qnrkfiqmtqzpyocxxtsk@fo rum.dlang.org OS: All Status: NEW Keywords: spec Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: dfj1esp02@sneakemail.com Given difficulties with adding compiler recognized attributes as seen in DIP1017, how about temporarily reserving UDAs with certain naming convention as keywords (like @safe)? Because they have usual UDA syntax, their status as keywords can be lifted later (ldc and gdc already implement compiler recognized UDAs). Possible naming conventions: 1. Prefix 'd', e.g. @dnoreturn 2. Prefix '_', e.g. @_noreturn or @_noreturn_ 3. Prefix 'core', e.g. @core_noreturn Declared like --- module core.attribute; struct noreturn { bool enabled; } alias noreturn _noreturn_; --- Compiler should create normal UDAs for them to verify that specified symbols are visible (declared in core.attribute). Can this simplify language extensibility? -- |
Copyright © 1999-2021 by the D Language Foundation