[Zope-Perl] Python and Perl scripts

Gisle Aas gisle@ActiveState.com
19 Oct 2000 15:06:09 -0700


Michel Pelletier <michel@digicool.com> writes:

> Well, Jim, Evan, Brian and I pow-wowed yesterday and came up with an
> interesting change.  The world 'Method' is too overlaoded, as it means
> too much to too many people.  Also, Python Methods don't work like
> methods in python, which was my argument, but they are very useful and
> there are sound reasons for them working like they do (which J, E and B
> convinced me of yesterdat).  We have decided to change the name of
> Python Methods to something else, the current candidate being 'Python
> Script'.
> 
> 'Script' objects make a lot of sense, they don't overload the concept of
> methods, they describe an action that people commonly want to do (script
> the web) and they clear up a lot of potential confusion for newbie and
> old-hat alike.
> 
> The bonus for all of this is that the only thing that needs to change is
> the name.  Which name is still an issue though, and we want your input. 
> what do you think of the idea of Perl Script objects?

I think it is a bit confusing since we already use that name for the
ActiveX scripting engine. See:

  http://www.ActiveState.com/Products/ActivePerl/docs/Components/Windows/PerlScript.html

Other than that I agree that this is a better name.

> The other issue, for the sake of documentation, is variable binding
> (which was the root of our disagreement yest. Python Methods do not bind
> variables and argument like methods in python do).  From what I can see,
> Perl Methods seem to get 'self' pass in as a first argument.

PerlMethods just fake a 'func_code' attribute and then take whatever
ZPublisher can give us based on that.

> Is this all there is too it or are there more details?

That should be all.

>                                             Python Methods have five
> special variables (defined on the bindings tab) that get created in the
> namespace of the method.  Should perl methods work the same way and not
> have special variables passed in as arguments?

They should probably work the same.  The PythonMethods I have does not
have any "bindings tab".  Is there anywhere I can pick up some newer
version.

>                                              This would probably be
> more consistent with the Python model, and since 'self' will probably
> not be the name of the variable bound to either the container or the
> context it should be more explicit for perl methods also.

perl methods should be as close to python methods as they can.

Regards,
Gisle