<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Manu,</DIV>
<DIV> </DIV>
<DIV>as a workaround would marker interfaces help to solve your problem for the
time being?</DIV>
<DIV> </DIV>
<DIV>This is just a suggestion for the time being, as I agree with you,
attributes/annotations are quite handy.</DIV>
<DIV> </DIV>
<DIV>--</DIV>
<DIV>Paulo</DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM-COLOR: #000000; BORDER-LEFT: #000000 4px solid; BORDER-TOP-COLOR: #000000; PADDING-LEFT: 5px; BORDER-RIGHT-COLOR: #000000; MARGIN-LEFT: 5px">
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV>"Manu" <turkeyman@gmail.com> wrote in message
news:mailman.1363.1333627256.4860.digitalmars-d@puremagic.com...</DIV></DIV></DIV>
<DIV
style="BORDER-BOTTOM-COLOR: #000000; BORDER-LEFT: #000000 4px solid; BORDER-TOP-COLOR: #000000; PADDING-LEFT: 5px; BORDER-RIGHT-COLOR: #000000; MARGIN-LEFT: 5px">
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV>I just want to add more real-world experience to the controversy.</DIV>I'm
finding myself needing to use custom attributes almost every day.
<DIV> </DIV>
<DIV>
<DIV>I have numerous systems that need to scan the module for things marked
accordingly to automate bindings to their respective systems.</DIV>
<DIV> </DIV></DIV>
<DIV>This is my current list of attributes I want to mark things with:</DIV>
<DIV> Export to game engine</DIV>
<DIV> Export to script language</DIV>
<DIV> Import from game engine</DIV>
<DIV> ** Import from script language (tentative, I'm sure I'll need it in
a few more days)</DIV>
<DIV> Expose to editor (with additional properties; description, edit
type, etc)</DIV>
<DIV> Serialise (load/save game)</DIV>
<DIV> Replay serialisation (a different kind of serialisation that works
with different data sets)</DIV>
<DIV> </DIV>
<DIV>And others I've encountered in passing that I can't recall right now.</DIV>
<DIV> </DIV>
<DIV>As you can imagine, any attempt to 'work around' the lack of an attribute
system, ie, (ab)using enums, etc as have been suggested, leads to a big mess in
the context of all these requirements.</DIV>
<DIV>Management of such lists of stuff in disconnected places in code is time
consuming, thoroughly annoying, error-prone, difficult to maintain, and leaves
programmers with the bitter taste of C++.</DIV>
<DIV>Alternatively, wrapping virtually every single declaration made in mixin()
and declaring everything as strings is even more nasty, and the contrast between
mixin() declarations and 'normal' declarations looks completely stupid. (Totally
unreadable + difficult to understand, breaks intellisense, code completion,
syntax hilighting, etc... ie, unusable)</DIV>
<DIV> </DIV>
<DIV>Does anyone have a *realistic* suggestion for emulating custom attributes?
Something that doesn't have any(/many) of the side effects I mention?</DIV>
<DIV>I haven't come up with anything that's acceptable yet.</DIV>
<DIV> </DIV>
<DIV>If not, I assert that D absolutely needs a custom attribute system. For us
here, this will enable D the single biggest advantage over using C++ in the same
context that I've identified so far.</DIV>
<DIV>D's meta-programming is amazing, but sadly, proving pointless to me right
now without being able to mark stuff appropriately. All the meta magic is
hovering just out of my grasp, due to the fact I have no way to indicate what
items should involve with what systems.</DIV>
<DIV>Currently, I have to maintain big registry tables of junk that must be
amended/updated any time anyone adds/changes anything... and I'm feeling rather
embarrassed when I tell the other non-D programmers that they just need to
update this table here... and here... and make sure that's in sync too before
their stuff will just 'magically' work ;)</DIV>
<DIV> </DIV>
<DIV>C# and Java both have attributes, following these established design
patterns, I don't think there should be any mystery over how they should be
implemented.</DIV></DIV></DIV></DIV></DIV></BODY></HTML>