| Store | Cart

Extending Python Syntax with @

From: John Roth <news...@jhrothjr.com>
Wed, 10 Mar 2004 16:50:58 -0500
"David MacQuigg" <dmq at gain.com> wrote in message
news:s2vu409dio5vc9ndl81dcinteagrkpntf5 at 4ax.com...
> Seems like we need a simple way to extend Python syntax that doesn't> break existing syntax or clash with any other syntax in Python, is> easy to type, easy to read, and is clearly distinct from the "base"> syntax.  Seems like we could put the @ symbol to good use in these> situations.  Examples:

There is indeed a cost to adding new keywords and operators;
it's possible that existing programs will break. It's quite possible
to design a language where this wouldn't happen, but Python is
not that language.

As it turns out, there is one very simple key to a language
with keywords where adding new ones won't break existing
programs: put them in a lexically distinguishable namespace.
It happens that solution is quite unpleasant to work with -
unless it's supported by a syntax aware editor/IDE. Someday
people will get over their attachment with being able to write
programs with any old text editor that happens to be lying
around, and being able to print their programs without
needing a special formatting program, but that day isn't today,
and I doubt if it's tomorrow.

The problem with adding new operators is a quite different
issue. It arises from the language designer trying to be too
nice to the developers. If the lexer simply collected the longest
possible string of special characters *before* checking if that
collection of special characters made a valid token, and declared
a syntax error if it didn't, then there would be no difficulty with
adding new operators.

That solution is also fairly unpleasant: we're a bit too used to
being able to string special character operators together without
separating them with white space. Again, an intelligent editor/IDE
would help here, too.

An intelligent editor/IDE would also make it possible to add
any of the numerous mathematical symbols from the Unicode
set easily: it could adjust for the developer's preferences in
entering them, and would, of course, display them properly.

I am, I suppose, getting old and cynical enough to have quit
expecting anything quite so radical as a language that actually
expectes the editor/IDE to pull its share of the work.

John Roth

Recent Messages in this Thread
David MacQuigg Mar 10, 2004 09:01 pm
Wayne Folta Mar 10, 2004 09:24 pm
Jarek Zgoda Mar 10, 2004 09:26 pm
Jeff Epler Mar 10, 2004 09:31 pm
Ivan Voras Mar 10, 2004 09:49 pm
Erik Max Francis Mar 11, 2004 01:08 am
John Roth Mar 10, 2004 09:50 pm
Ben Finney Mar 10, 2004 10:19 pm
John Roth Mar 10, 2004 11:15 pm
Josiah Carlson Mar 12, 2004 05:08 pm
Y2KYZFR1 Mar 12, 2004 05:49 am
Max M Mar 12, 2004 09:59 am
John Roth Mar 12, 2004 12:05 pm
Heather Coppersmith Mar 11, 2004 02:05 am
Edward K. Ream Mar 10, 2004 11:02 pm
David MacQuigg Mar 11, 2004 12:40 am
Cameron Laird Mar 11, 2004 01:28 am
David MacQuigg Mar 11, 2004 02:44 am
Pierre Rouleau Mar 11, 2004 03:13 am
Christopher Koppler Mar 11, 2004 09:00 am
Isaac To Mar 11, 2004 01:54 am
Pierre Rouleau Mar 11, 2004 02:59 am
Christopher Koppler Mar 11, 2004 08:50 am
Nick Vargish Mar 11, 2004 02:28 pm
Peter Hickman Mar 11, 2004 02:50 pm
Cameron Laird Mar 11, 2004 03:24 pm
Peter Hickman Mar 12, 2004 09:50 am
John Roth Mar 12, 2004 12:07 pm
Peter Hickman Mar 12, 2004 12:19 pm
David MacQuigg Mar 11, 2004 08:05 pm
Roger Binns Mar 11, 2004 01:08 am
DH Mar 11, 2004 01:37 am
Roger Binns Mar 11, 2004 04:06 am
Steve Lamb Mar 11, 2004 01:43 am
Gustavo Niemeyer Mar 11, 2004 03:12 am
Paul McGuire Mar 11, 2004 03:17 am
Peter Maas Mar 11, 2004 12:15 pm
David MacQuigg Mar 11, 2004 04:35 pm
Peter Hansen Mar 11, 2004 05:01 pm
David MacQuigg Mar 11, 2004 05:57 pm
Ixokai Mar 14, 2004 05:17 am
Peter Maas Mar 11, 2004 08:42 pm
David MacQuigg Mar 11, 2004 11:44 pm
Raymond Hettinger Mar 11, 2004 10:15 pm
Paul Rubin Mar 11, 2004 11:24 pm
wmwd...@sneakemail.com ) (Greg Ewing (using news.cis.dfn.de) Mar 12, 2004 03:12 am
Bas Mar 12, 2004 08:07 pm
Peter Hansen Mar 12, 2004 10:17 pm
Donn Cave Mar 12, 2004 10:57 pm
Cameron Laird Mar 11, 2004 12:55 pm
Kyler Laird Mar 11, 2004 02:09 pm
Richie Hindle Mar 11, 2004 02:41 pm
David MacQuigg Mar 11, 2004 02:49 pm
Kyler Laird Mar 11, 2004 06:09 pm
David M. Cooke Mar 11, 2004 09:26 pm
Kyler Laird Mar 12, 2004 12:01 am
Myles Mar 12, 2004 12:05 am
John Roth Mar 11, 2004 02:37 pm
David MacQuigg Mar 11, 2004 03:57 pm
John Roth Mar 11, 2004 04:17 pm
David MacQuigg Mar 11, 2004 05:41 pm
John Roth Mar 11, 2004 06:03 pm
David MacQuigg Mar 11, 2004 09:24 am
Cameron Laird Mar 11, 2004 05:13 am
David MacQuigg Mar 11, 2004 08:42 am
Cameron Laird Mar 11, 2004 03:35 pm
Cameron Laird Mar 12, 2004 01:19 am
wmwd...@sneakemail.com ) (Greg Ewing (using news.cis.dfn.de) Mar 12, 2004 03:11 am
Messages in this thread