Thread overview | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 30, 2004 the "debug" feature | ||||
---|---|---|---|---|
| ||||
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 |
June 30, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | 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 dennis > Most statements in D can also be used to define a block (using { and } ) Try this: # debug{ # void test(int x){ ... } // like an complete debug{ ... } span # class test1 {...} # } Compile with "-debug" and you're in business. - Pragma |
June 30, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to pragma | 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 dennis > Most 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 |
June 30, 2004 Re: the "debug" feature | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | 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 dennis > > Have you tried it? It should work fine. http://www.digitalmars.com/d/attribute.html D's attributes are brilliant. Sam |
June 30, 2004 Re: the "debug" feature | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sam McCall | 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 dennis > Have you tried it? It should work fine. > http://www.digitalmars.com/d/attribute.html > D's attributes are brilliant. looks like what i want |
June 30, 2004 Re: the "debug" feature | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | >> Have you tried it? It should work fine.
>> http://www.digitalmars.com/d/attribute.html
>> D's attributes are brilliant.
> looks like what i want
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 dennis
|
June 30, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | 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 dennis Sometimes 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: #//begin_generated_code (do not remove this line) # public void __generated_method_a(){} #//end_generated_code (do not remove this line) Or if you need to tag definitions one at a time: #/+generated+/ public void __generated_method_a(){} - Pragma |
June 30, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to pragma | > ...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 too > I know that Visual Studio has used comments as markers for auto-generated code > for the longest time: > #//begin_generated_code (do not remove this line) > # public void __generated_method_a(){} > #//end_generated_code (do not remove this line) > Or if you need to tag definitions one at a time: > #/+generated+/ public void __generated_method_a(){} 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? |
June 30, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | 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 solution I 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 C#. - Pragma |
July 01, 2004 Re: the | ||||
---|---|---|---|---|
| ||||
Posted in reply to pragma | pragma <EricAnderton at yahoo dot com> wrote: > 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 solution > I agree.. but hey, it'll work for now right? 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 features >>@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 > C#. which C# feature? name? |
Copyright © 1999-2021 by the D Language Foundation