A 'Python like' language

Greg Ewing (using news.cis.dfn.de) ieyf4fu02 at sneakemail.com
Mon Mar 29 00:59:42 EST 2004


Stephen Horne wrote:
> On a separate issue, the Prothon developers seem to have the mistaken
> view that commas influence line continuation in Python. They don't -
> but parentheses, square brackets and braces do. Though the Prothon
> extra-indentation system (which is similar to Haskells offside rule, I
> suppose) is an interesting idea.

I like that, too, but why do they require *two* extra levels of
indenting to trigger it? Surely one would be enough?

Some other impressions:

* I'm not sure I like the leading-dot notation. The code
   examples look untidy to my eyes; there's too much punctuation
   and not enough stuff being punctuated. Maybe I could get
   used to it... or maybe not.

* I definitely don't like the line-noise & and @ prefixes.
   At least I would never have to use the @ (who in their
   right mind actually *wants* dynamic scoping in this day
   and age?-)

* A bit of syntactic sugar for defining prototype objects
   wouldn't go amiss. Having to say

     Thing = Base()
     with Thing:
        ...

   every time I want to define a class (oops, sorry, prototype)
   would drive me batty. I'd much rather write something like

     object Thing(Base):
       ...

   By the way, did anyone figure out how you give an object
   multiple prototypes? I don't remember seeing an example of
   that.

* It's not clear whether there is any such thing as a bound
   method in Prothon, i.e. whether you can do

     f = someobj.somemeth
     f()

   and have it do what a Pythoneer would expect. And if so,
   what happens if you do

     f = someobj.somemeth
     someotherobj.g = f
     someotherobj.g()

   What does the "self" object inside the call to somemeth
   refer to then -- someobj, or someotherobj?

   Answering that question may shed some light on what was
   asked earlier: Do we really need classes?

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list