Fully Bracketed Syntax

Eaglestone, Robert [NGC:B918:EXCH] eaglesto at americasm01.nt.com
Thu Feb 10 17:13:11 EST 2000


Hello all,

In general, it seems to me that all good programmers
indent their code.  However, mandating it as part of
the form of a language sounds ... strange.

However, I don't like the BEGIN...END bracketing done
by Pascaline languages; neither do I love the {...}
of C and its descendants.

Has the creator of Python looked into fully bracketed
syntax?  That might not be the actual term, so here's
an example of what I'm thinking about:

if ( foo > bar )
   do_something();
   do_something_else();
   done();
endif

This bracketing gets the best [ or worst ] of both
worlds, with a bit of syntactic sugar added for free.
The lead bracket is the keyword itself, and the end
bracket is tailored for that keyword alone.  Only
one 'line' is 'wasted' by the end bracket (Python
doesn't like wasting lines).  And indentation is no
longer a language issue.

I only know of one language which uses this syntax,
and it's not in common use.  However, lots of us may
have seen this kind of syntax in college (hey!  is it 
part of ML?).

I guess what I'd like is some clear reasoning about
bracketing and indenting that warrants such a feature 
of a language.

Thanks,
Rob



More information about the Python-list mailing list