Why we will use obj$func() often

Mark Hahn mark at prothon.org
Fri Apr 23 04:24:42 EDT 2004


Mike C. Fletcher wrote:

> Fascinating.  Most users never even notice this stuff, let alone getting
> so worked up about it that they start a whole separate language ;) .

Well, I do exaggerate a bit :)

> super(), in other words, is a practical solution to avoiding the
> explicit dependencies that crop up when you directly reference a
> super-class.

Prothon also has a seperate super operator ( ^ ).   ^var means to get the
first attrbute named var from a prototype of self instead of self itself.
It uses the ordered list of prototypes like Python does.  So ^func() does
what you are referring to.

Internally in the interpreter I have the full Python super function almost
exactly.  It's no coincidence.  You need that to make inheritance work.  I
can bring it out for the Prothon user, but I originally designed prothon
with keywords and symbols, not functions, something I'm taking a lot of heat
for now.

> Sure, the magic you sprinkle through your system is part of its
> flavour
> and character, that character is how languages sell themselves.
> Though honestly, if someone seriously came up to me and said:
>
>     "Switch to Frobnaz, it has explicit syntax for referencing a
>     superclass rather than that archaic explicit invocation stuff in
> Python"
>
> I'd probably dismiss them out of hand as being so totally out of touch
> with reality as to be not worth the effort of listening (well, not
> really, I *try* not to dismiss people out of hand no matter how crazy
> they are).  Addressing a few of Python's warts is *not* going to make
> the world beat a path to your door.

You've stretched my "one more thing to pitch" statement to the extreme
statement of "switch to this because of this one thing".   Of course one
isn't going to care about one thing.

> Your language *will* have it's own warts, that's a simple reality,
> pointing out that you don't have the same warts *in the same places*
> as another language is not a compelling argument for switching.  For
> instance, I would almost certainly consider the fishHeight$Somewhere()
> syntax to be a wart ;)

You may very well be right.  I'm trying to get it to fit into an overall
scheme, but it may not work.  By itself it definitely is a wart.  Don't
forget that you are looking at it in the context of Python.  It is being put
into a different language with different problems.

My biggest problem right now is stupid aesthetics.  I have to decide where
to place Prothon on the continuum between lisp and perl.  When I crossed the
line and added $ for self people screamed bloody murder that it looked like
Perl.  Before when I had a period for self they thought it looked great.  I
can't believe how much they care about something so silly.

Anyway, thanks very much for your input.  I'm sorry if you wore out your
keyboard.  Luckily the prices have really come down :)





More information about the Python-list mailing list