|
From: Ben H. <be...@in...> - 2001-01-12 03:52:55
|
This posting is about language design. I want to pose the question: Is
there a way to tweak Jython so that the "self" reference that refers the
containing instance can be implicitly, like the implicit "this" pointer
of java or C++?
Im a java developer who feels very comfortable with the OO paradigm, yet
am attracted to Jython because the it makes somethings that are too hard
in java much easier: map(), list slicing, keyword arguments. But the
need to explictly specify self.X and self.Y and pass it to instance
methods disturbs me. It makes Python's OO features look something of an
afterthought, grafted on to a imperative/functional language. Using this
frequent, default construct, seems like uneccesary hard work.
eg:
class MyClass:
def __init__(self, name):
def doIt(self):
becomes:
class MyClass:
def __init__(name):
def doIt():
which seems far more natural (and easier) from a java point of view.
Why cant "self" be prepended to all functions and vars by default, when
inside a class definition?
If this issue has already been thrashed out on a forum, please refer me
an archive link.
Regards
Ben
--
Ben Hutchison
Software Engineer-Market Predictor
Webmind Australia
http://www.webmind.com/productspredictor.html
|