digitalmars.D - the "debug" feature
- dennis luehring (6/6) Jun 30 2004 it would be nice to have a feature to declare complete
- pragma (9/15) Jun 30 2004 Most statements in D can also be used to define a block (using { and } )...
- dennis luehring (9/20) Jun 30 2004 i know this but wouldn't it be nice to reduce this block spanning with
- Sam McCall (5/15) Jun 30 2004 Have you tried it? It should work fine.
- dennis luehring (2/15) Jun 30 2004 looks like what i want
- dennis luehring (18/22) Jun 30 2004 in some of my projects codegernators were used to "publish" methods
- pragma (11/29) Jun 30 2004 Sometimes simple is best. I like what you're trying here, but I think D...
- dennis luehring (4/13) Jun 30 2004 i think that hiding such control-information in comments or special
- pragma (5/8) Jun 30 2004 I wouldn't mind a feature like that one bit, even if it does sound a bit...
- dennis luehring (5/12) Jul 01 2004 it must not work "now" - cause i've got (currently)
- pragma (25/29) Jul 01 2004 C#, and .NET in general, supports arbitrary attributes for almost anythi...
- J C Calvarese (24/53) Jul 02 2004 Have you considered using version
it would be nice to have a feature to declare complete modules/fucntions/classes/methods as debug for example (as an idea): debug void test(int x){ ... } // like an complete debug{ ... } span debug class test1 {...} ciao dennis
Jun 30 2004
In article <cbuj0e$bgk$1 digitaldaemon.com>, dennis luehring says...it would be nice to have a feature to declare complete modules/fucntions/classes/methods as debug for example (as an idea): debug void test(int x){ ... } // like an complete debug{ ... } span debug class test1 {...} ciao dennisMost statements in D can also be used to define a block (using { and } ) Try this: Compile with "-debug" and you're in business. - Pragma
Jun 30 2004
pragma <EricAnderton at yahoo dot com> wrote:In article <cbuj0e$bgk$1 digitaldaemon.com>, dennis luehring says...it would be nice to have a feature to declare complete modules/fucntions/classes/methods as debug for example (as an idea): debug void test(int x){ ... } // like an complete debug{ ... } span debug class test1 {...} ciao dennisMost statements in D can also be used to define a block (using { and } )i know this but wouldn't it be nice to reduce this block spanning with just one keyword at the right place? just to reduce the block count or an feature to use this not a class defition time for example maybe i want to do this: debug ClassTest test_as_debug; ClassTest test_as_releas; in this scenario i want only the object "test_as_debug" with debug information
Jun 30 2004
dennis luehring wrote:it would be nice to have a feature to declare complete modules/fucntions/classes/methods as debug for example (as an idea): debug void test(int x){ ... } // like an complete debug{ ... } span debug class test1 {...} ciao dennisHave you tried it? It should work fine. http://www.digitalmars.com/d/attribute.html D's attributes are brilliant. Sam
Jun 30 2004
Sam McCall wrote:dennis luehring wrote:it would be nice to have a feature to declare complete modules/fucntions/classes/methods as debug for example (as an idea): debug void test(int x){ ... } // like an complete debug{ ... } span debug class test1 {...} ciao dennisHave you tried it? It should work fine. http://www.digitalmars.com/d/attribute.html D's attributes are brilliant.looks like what i want
Jun 30 2004
in some of my projects codegernators were used to "publish" methods through an command-pattern based plugin system... can i use this feature for code generators: (in need a marker for my parser to find "to published functions") for example: (pseudo code) class Test { private: funct1 funct2 public: funct3 for_the_generator: funct4 funct5 } ciao dennisHave you tried it? It should work fine. http://www.digitalmars.com/d/attribute.html D's attributes are brilliant.looks like what i want
Jun 30 2004
In article <cbunvc$ipn$1 digitaldaemon.com>, dennis luehring says...in some of my projects codegernators were used to "publish" methods through an command-pattern based plugin system... can i use this feature for code generators: (in need a marker for my parser to find "to published functions") for example: (pseudo code) class Test { private: funct1 funct2 public: funct3 for_the_generator: funct4 funct5 } ciao dennisSometimes simple is best. I like what you're trying here, but I think D will reject this since 'for_the_generator' is not a valid attribute. I know that Visual Studio has used comments as markers for auto-generated code for the longest time: Or if you need to tag definitions one at a time: - Pragma
Jun 30 2004
...I like what you're trying here, but I think D will reject this since 'for_the_generator' is not a valid attribute.i like my ideas tooI know that Visual Studio has used comments as markers for auto-generated code for the longest time: Or if you need to tag definitions one at a time:i think that hiding such control-information in comments or special names is a dirty other-language-like solution walter: what about defineable attributes for D?
Jun 30 2004
In article <cbuv5u$t6j$1 digitaldaemon.com>, dennis luehring says...i think that hiding such control-information in comments or special names is a dirty other-language-like solutionI agree.. but hey, it'll work for now right?walter: what about defineable attributes for D?I wouldn't mind a feature like that one bit, even if it does sound a bit like - Pragma
Jun 30 2004
pragma <EricAnderton at yahoo dot com> wrote:In article <cbuv5u$t6j$1 digitaldaemon.com>, dennis luehring says...it must not work "now" - cause i've got (currently) no D based projects - but in the future it would be nice to have such featuresi think that hiding such control-information in comments or special names is a dirty other-language-like solutionI agree.. but hey, it'll work for now right?walter: what about defineable attributes for D?I wouldn't mind a feature like that one bit, even if it does sound a bit like
Jul 01 2004
In article <cc0d87$13g$1 digitaldaemon.com>, dennis luehring says...the language. The idea is that you can assign attributes to classes, instances and such to give the compiler hints on what to do with a given item. *Custom* attributes are only really useful via reflection, and allows you to do some code and can be used within the same project sourcecode as where it is used. This gives you a very powerful way to make class metadata far more meaningful than just raw class info. For example, I once created a class that would initalize static members on classes, in an arbitrary assembly, from data in an XML file. This utility would look for "[StaticInit]" attributes tagged to static struct and class members and set their values based on their name and hosting class. This was accomplished through 100% reflection, including dynamically loading the assemblies into the runtime as referenced in the config file. Similar techniques can be applied to *intellegently* implement transparent serialization, automatic proxy creation for remoting, etc etc. There may be reasons why you wouldn't want to persist every member of a class or to do special things with making certain methods available over the wire. A facility like this makes it all possible. I for one would love to see a similar, or more advanced, set of features in the next full release of D (version 2?). :) Here's a pretty good article on the topic: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkattributestutorial.asp - Pragmawalter: what about defineable attributes for D?I wouldn't mind a feature like that one bit, even if it does sound a bit like
Jul 01 2004
dennis luehring wrote:Have you considered using version (http://www.digitalmars.com/d/version.html). I'm not sure I understand the purpose of your proposed User Defineable Attributes, but I think you can effectively emulate them by making using of D's existing versioning features. It's a little more wordy than your proposal, but I think it'll work. Here's an example: version(myCodeGeneration) version = published; class Plugin { public: void Function1(...) int Function2(...) version(published) { int Function3(...) int m_nMaxCount } private: } The code in the version block is only compiled if the myCodeGeneration or published version is set, such as: dmd test.d version=myCodeGeneration -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/in some of my projects codegernators were used to "publish" methods through an command-pattern based plugin system... can i use this feature for code generators: (in need a marker for my parser to find "to published functions") for example: (pseudo code) class Test { private: funct1 funct2 public: funct3 for_the_generator: funct4 funct5 } ciao dennisHave you tried it? It should work fine. http://www.digitalmars.com/d/attribute.html D's attributes are brilliant.looks like what i want
Jul 02 2004