www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - About and UDA

reply "Andrea Fontana" <nospam example.com> writes:
My 2 cents. If I remember correctly, " " prefix in  safe, 
 trusted,  system, etc was added just to avoid keywords 
pollution, right?

Now UDA uses the same prefix: if some new 
keywords/properties/attributes will be added to D, the same 
problem will come back again... Is it a crazy idea to deprecate   
for UDAs in favor of something else like #? In this way  xxx will 
be a language attribute and #xxx will be a user defined 
attribute. No pollution, no clashes.

Maybe it's not too late to do this change. I think it will be not 
a big effort to replace uda syntax in existing projects (a 
deprecation warning will help).


Andrea
Apr 15 2015
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-04-15 10:53, Andrea Fontana wrote:
 My 2 cents. If I remember correctly, " " prefix in  safe,  trusted,
  system, etc was added just to avoid keywords pollution, right?

 Now UDA uses the same prefix: if some new keywords/properties/attributes
 will be added to D, the same problem will come back again... Is it a
 crazy idea to deprecate   for UDAs in favor of something else like #? In
 this way  xxx will be a language attribute and #xxx will be a user
 defined attribute. No pollution, no clashes.
Yes, it would be a crazy idea. Actually, there's already another syntax, deprecated, for UDA's. It was deprecated when it was added. Then the current syntax was added.
 Maybe it's not too late to do this change. I think it will be not a big
 effort to replace uda syntax in existing projects (a deprecation warning
 will help).
No, the solution is to add any new attributes, not as keywords but as compiler recognized UDA's. Then it's possible to use the fully qualified name of the UDA to disambiguate. -- /Jacob Carlborg
Apr 15 2015
prev sibling parent reply ketmar <ketmar ketmar.no-ip.org> writes:
On Wed, 15 Apr 2015 08:53:05 +0000, Andrea Fontana wrote:

 My 2 cents. If I remember correctly, " " prefix in  safe,  trusted,
  system, etc was added just to avoid keywords pollution, right?
=20
 Now UDA uses the same prefix: if some new keywords/properties/attributes
 will be added to D, the same problem will come back again... Is it a
 crazy idea to deprecate  
 for UDAs in favor of something else like #? In this way  xxx will be a
 language attribute and #xxx will be a user defined attribute. No
 pollution, no clashes.
=20
 Maybe it's not too late to do this change. I think it will be not a big
 effort to replace uda syntax in existing projects (a deprecation warning
 will help).
or make "safe" and company "context keywords". along with "body" (oh, how=20 i hate the unabilily to declare "body" member!")=
Apr 15 2015
next sibling parent reply "Vlad Levenfeld" <vlevenfeld gmail.com> writes:
On Wednesday, 15 April 2015 at 16:59:12 UTC, ketmar wrote:
 or make "safe" and company "context keywords". along with 
 "body" (oh, how
 i hate the unabilily to declare "body" member!")
Ugh, yeah. Makes physics code awkward.
Apr 16 2015
parent "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Thursday, 16 April 2015 at 20:09:07 UTC, Vlad Levenfeld wrote:
 On Wednesday, 15 April 2015 at 16:59:12 UTC, ketmar wrote:
 or make "safe" and company "context keywords". along with 
 "body" (oh, how
 i hate the unabilily to declare "body" member!")
Ugh, yeah. Makes physics code awkward.
And DOM.
Apr 16 2015
prev sibling parent reply =?ISO-8859-15?Q?S=F6nke_Ludwig?= <sludwig rejectedsoftware.com> writes:
Am 15.04.2015 um 18:59 schrieb ketmar:
 On Wed, 15 Apr 2015 08:53:05 +0000, Andrea Fontana wrote:

 My 2 cents. If I remember correctly, " " prefix in  safe,  trusted,
  system, etc was added just to avoid keywords pollution, right?

 Now UDA uses the same prefix: if some new keywords/properties/attributes
 will be added to D, the same problem will come back again... Is it a
 crazy idea to deprecate  
 for UDAs in favor of something else like #? In this way  xxx will be a
 language attribute and #xxx will be a user defined attribute. No
 pollution, no clashes.

 Maybe it's not too late to do this change. I think it will be not a big
 effort to replace uda syntax in existing projects (a deprecation warning
 will help).
or make "safe" and company "context keywords". along with "body" (oh, how i hate the unabilily to declare "body" member!")
+1 for body I still haven't got the reason though, why "safe" and friends cannot simply be UDAs defined in object.d that the compiler recognizes. I'd also reserve a bunch of attributes now to avoid a never ending sequence of breaking changes (such as good anti-keywords to scope, immutable, pure etc.).
Apr 17 2015
parent reply Jacob Carlborg <doob me.com> writes:
On 2015-04-17 16:34, Sönke Ludwig wrote:

 +1 for body

 I still haven't got the reason though, why "safe" and friends cannot
 simply be UDAs defined in object.d that the compiler recognizes.
UDA's were available when these attributes/keywords were created. Reasons why they're still not UDA's are probably a mix of avoiding code breakage and someone that needs to make the change. -- /Jacob Carlborg
Apr 17 2015
parent Jacob Carlborg <doob me.com> writes:
On 2015-04-17 21:35, Jacob Carlborg wrote:

 UDA's were available when these attributes/keywords were created.
 Reasons why they're still not UDA's are probably a mix of avoiding code
 breakage and someone that needs to make the change.
Were _not_ available ... -- /Jacob Carlborg
Apr 18 2015