Python Rocks! - get rid of colons
Ian Parker
parker at gol.com
Sun Jan 23 09:04:17 EST 2000
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.
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).
--
Ian Parker
More information about the Python-list
mailing list