Re: Decorator feature...

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
"Mukhsein Johari" <[email protected]>

> Sorry for picking on things again but I'm just not
> convinced defInit and runInit are needed. (Heh, call
> me "The Feature Killer" or more simply "Wet Blanket"

No, please pick away.  I want discussion here.

> :-p) Seriously though, could you supply a more
> concrete example of defInit?

Any argument for a decorator is an argument for defInit.  Look at the
command_ feature for an example.

> As for runInit, it only becomes useful when the
> function is called, right? So we can just as easily:
>
> -----------------------
> def funcB():
>   <do stuff>
>
> funcB.staticVar = 0
>
> funcB()
> funcB.staticVar +! 1
> -----------------------

That is not a substitute.  The init code should be with the function.  What
if you don't have access to the calling code?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.