Why is Python popular, while Lisp and Scheme aren't?

Carl Banks imbosol at vt.edu
Wed Nov 13 13:41:00 EST 2002


Michael Hudson wrote:
> Carl Banks <imbosol at vt.edu> writes:
> 
>> do_A()
>> if test_based_on_A():
>>     take_action_A()
>> else:
>>     do_B()
>>     if test_based_on_B():
>>         take_action_B()
>>     else:
>>         do_C()
>>         if test_based_in_C():
>>             take_action_C()
>>         else:
>>             ...
> 
> *This* is asking to be written as a loop:

Not for me.  I wouldn't use a loop in this situation, unless the
operations in the loop were dynamic.  The loop interrupts the logical
flow and makes it a chore for a human reader to track down what's
happening.  I'll probably just factor the whole sequence into a
function and use return when I got a match.

I guess some people have hissyfits if they have to use break or
return; I don't.


and-if-I-were-programming-in-C-I'd-just-use-goto-ly yr's

-- 
CARL BANKS



More information about the Python-list mailing list