[Python-Dev] conditional expressions?

Daniel Mahler mahler@cyc.com
Tue, 16 Oct 2001 11:11:06 -0500


Guido van Rossum writes:

 > (1) In order to do short-circuiting evaluation, the name would have to
 >     be recognized by the parser, which means it would have to be a new
 >     keyword. 

That surprises me.
In a conventional compiler architecture,
I would expect this to be a static analysis and code generation issue.
In languages that have multiple parameter passing disciplines
(eg Pascal, Simula), 
the parser does not track how any given argument is being passed.

 > (2) It looks too much like a function call for my comfort.

I am trying to make the case that it *is* a function call,
with args 2 & 3 being passed by-name.
Or at least it can very sensibly be viewed and implemented that way.

 > 
 > I still like
 > 
 >     (if cond then expr else expr)
 > 
 > better than any of these.

:(

 > --Guido van Rossum (home page: http://www.python.org/~guido/)
 > 
 > _______________________________________________
 > Python-Dev mailing list
 > Python-Dev@python.org
 > http://mail.python.org/mailman/listinfo/python-dev

Daniel