[Python-Dev] conditional expressions - add parens? (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 8 01:32:20 CET 2006
- Previous message: [Python-Dev] conditional expressions - add parens?
- Next message: [Python-Dev] conditional expressions - add parens?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jeremy Hylton wrote:
Perhaps the solution is to require parens around all expressions, a simple consistent rule.
I actually designed a language with that feature once. It was an exercise in minimality, with hardly anything built-in -- all the arithmetic operators, etc. were defined in the language.
A result was that there was no built-in notion of precedence, and my solution was to require parentheses around every infix operation. So instead of
dsq = b * b - 4 * a * c
you would have had to write
dsq = ((b * b) - ((4 * a) * c))
I never got an implementation working well enough to find out how much of a disaster this would have been to use, though. :-)
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiam! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing at canterbury.ac.nz +--------------------------------------+
- Previous message: [Python-Dev] conditional expressions - add parens?
- Next message: [Python-Dev] conditional expressions - add parens?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]