Python Rocks! - get rid of colons
Will Rose
cwr at crash.cts.com
Sun Jan 23 09:55:11 EST 2000
Ian Parker <parker at gol.com> wrote:
: In article <867qt1$a49 at news.or.intel.com>, tye4 <tye4 at yahoo.com> writes
:>
:>I have Python installed on Linux Redhat 6.0. Does anyone know where the
:>source code for the compiler is located (any .tar file?). I intend to modify
:>the language's syntax to add
:>'end' delimiters for the blocks.
:>And since Python is copyrighted, I don't intend to flood out versions to
:>anyone else... strictly for personal use.
:>
:>class TestNew
:>
:> def foo(s):
:> for i in range(0, 10):
:> print i,
:> end loop
:>
:> if i == 10:
:> print 'internal error'
:> end if
:>
:> while i < 10:
:> print i
:> end loop
:> end def
:>
:>end class
:>
:>My end delimiters are inspired by Ada, which in my personal opinion has best
:>overall syntax.
:>
:>Thx,
:>
:>-tye4
:>
:>
: Well since you're going back to ADA, I've just recalled my favourite
: method of termination, in Algol 68: if.. fi, do..od convention, eg.
: if i == 10:
: print 'internal error'
: fi
: A68 used "for .. do .. od" or "while .. do .. od". For Python perhaps
: "rof" would be appropriate
: for i in range(0, 10):
: print i,
: rof
: Although I suppose to be more inline with Algol 68, you'd have to a
: reverse colon on the for statement, which might be unclear.
The pair I always liked were case ... esac, which I'm pretty sure
were Algol something.
: I got profoundly fed up with languages that required "end xxx" to
: terminate. However, I still prefer even that to simply using
: indentation (too much mixing of the message with the medium).
Ditto. Python has its faults (cries of no!, no!) but it's better than
all the alternatives. I wish it had a really mean syntax checker, tho';
or at least some way of requiring declaration before use.
Will
cwr at cts.com
More information about the Python-list
mailing list