[Zope-Perl] Method arguments

Michel Pelletier michel@digicool.com
Tue, 17 Oct 2000 17:47:03 -0700


There is some internal disagreement about what the variable 'self'
should be bound to in a python method.  I (and others) think it should
be bound to the object the method was bound do by URL.  Others think it
should be the container the method is defined in, consider the method:

    def aMethod(self):
      for object in self.objectValues():
        print object.getId() + ', '
      return printed

  Now consider the folders::

    /A

      /B

        /C  

  
  Calling::

    /A/aMethod

    /A/B/aMethod

    /A/B/C/aMethod

  *will allways return the same result* if 'self' is defined as the
  container, not the context.

See:

http://dev.zope.org/Wikis/DevSite/Projects/PythonMethods/UsuabilityIssues

the section "self is Container vs. Context" for more details of my
argument.

This has alot of effect on how Perl methods should interpret self, and
therefore your opinion is very important.

Since I am pretty much ignorant of how arguments in perl work we'd like
to know what you think.  From what Amos figger perl has, essentially,
positional arguments.  Is self an allways existing first argument?  is a
perl methods namespace munged to contain things found in a Python
methods *Bindings* view?

Thanks for any thoughts,

-Michel