For review: PEP 308 - If-then-else expression

William Park opengeometry at yahoo.ca
Sun Feb 9 12:46:10 EST 2003


Roy Smith <roy at panix.com> wrote:
> Piet van Oostrum <piet at cs.uu.nl> wrote:
>> We could then also have one for ints rather than bools:
>> 
>>         i -> [ v_0, v_1, v_2, ... ]
>> which would pick v_i and evaluate that.
>> Also here the [ ] is not really a list notation but belongs to the ->.
> 
> Just to inject a bit of history, this is FORTRAN's computed goto wrapped 
> up as an expression.

Hey, I like this:
    (condition) -> (command1, command2)
    (int) -> [expression0, expression1, ... ]
where '(condition)' is 'true' or 'false', and '(int)' is the usual list
index.  It flows easily.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data management and processing. 




More information about the Python-list mailing list