RE: Function once: concern

"Mark Hahn" <[email protected]> Wed, 14 Jul 2004 11:38:18 -0700
Newsgroups gmane.comp.lang.prothon.user
Message-ID <000301c469d1$bbd471c0$0b01a8c0@mark>
> From: Paul Prescod 

> > The once section has nothing to do with this problem.  This is a 
> >problem of  using static vars in different functions with the same 
> >name.
> 
> Why not have a "func." prefix like "self." or "outer.".

An interesting idea.

> > So far we have one vote specifically for once and your one vote 
> > specifically against once.  We have several votes for the overall 
> > proposal.  I haven't voted.
> > 
> > The one vote for is a usage case.  Your vote against is a good ole 
> > complication argument and nothing more.
> 
> Sorry, can you point me to the use case? 

http://www.prothon.org/pipermail/prothon-user/2004-July/002820.html

> Can you show me what 
> the code 
> looks like with the once: feature and without?

No.  You'll have to use your imagination.

> > By the way, what you two are calling init is now "outer" 
> and what you 
> > are calling once is now "init".  I never agreed to call 
> them init and 
> > once.  I might agree to call them "outer" and "once".
> 
> In my opinion this feature's syntax is straying too far away from the 
> original use cases.

I think outer usage cases are straying far away from Python's usage
cases.  Outer is useful for so much more and who knows what future uses
we might come up with.  That is the power of a good tool.  

Remember when you went to a meeting and came back thinking that Prothon
could do something that Python couldn't do even though I had no idea
what you were talking about?  That comes from my kind of flexible simple
open kind of thinking.  You are now asking me to think rigid and closed
like Python. Why?

Outer is already used in Python to mean outside the function.  This has
a well-known understood meaning.  It is one less thing for the
programmer to learn.  You are asking them to learn a new complex
decorator concept.  I only recently understood it after weeks of hearing
about it.  Serge had to send me several messages before I got it.

My main design goal in Prothon is to make things simple.  Outer is
simple.  Decorator is complex.  Outer is Prothonic.  Decorator is
Pythonic.  It is just like prototypes versus classes.  Classes are
Pythonic, Prototypes are Prothonic.

Sorry to hammer you on this but I obviously feel pretty strongly about
it.

Now let's figure out how to get rid of the need to say "func =
wrapper(func)".  Maybe just say "wrap wrapper" and it will default to
the immediately preceding def?