A 'Python like' language

Mark Hahn mark at prothon.org
Mon Mar 29 11:37:21 CEST 2004


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

This is a miscommunication.  When I say one extra level I mean the normal
indentation like after an if:.  Two extra is what I think you mean by one
extra.  In any case it works like you expect.

* 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?-)

I'm open to suggestions.  I used the Ruby prefix system for two reasons.
One is the instant readability instead of searching around the code looking
for global keywords or assignment statements.  The second is to get the fast
one-pass compiler.  But everything in Prothon is subject to change until
7/04.

As far as the dynamic scoping, I only put that in for completeness.  I had
all the others so I said what the hell.  You don't have to use it.  I have
some kind of vague idea how it might be used in something like wxWindows but
I have to work on that idea.  Go the Prothon list and voice your opinion.

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

I agree completely.  We are working on this area.

>    By the way, did anyone figure out how you give an object
>    multiple prototypes?

It sucks right now:

Proto = Proto1()
Proto.add_proto(Proto2)
obj = Proto()

There is a discussion about this whole area on the Prothon list right now.

>      f = someobj.somemeth
>      f()

Yes this is legal.

>      f = someobj.somemeth
>      someotherobj.g = f
>      someotherobj.g()
>
>    What does the "self" object inside the call to somemeth
>    refer to then -- someobj, or someotherobj?

It refers to someotherobj.

You can get the answer to these questions quickly youself with a download
from prothon.org.

Mark Hahn (Prothon Author)

"Greg Ewing (using news.cis.dfn.de)" <ieyf4fu02 at sneakemail.com> wrote in
message news:c48e0g$2fkvm2$1 at ID-169208.news.uni-berlin.de...
> 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