define loop statement?

Xavier Morel xavier.morel at masklinn.net
Thu Feb 16 20:34:07 EST 2006


Rene Pijlman wrote:
> David Isaac:
>> I would like to be able to define a loop statement
>> (nevermind why) so that I can write something like
>>
>> loop 10:
>>    do_something
>>
>> instead of
>>
>> for i in range(10):
>>    do_something
>>
>> Possible?  If so, how?
> 
> Yes. By implementing a compiler or an interpreter for your programming
> language. Or a preprocessor that converts your language to Python, or some
> other suitable intermediate language. Or a programmer, that converts your
> pseudocode and some coffee to the desired algorithm :-)
> 
Or by hacking through the Python source and creating his own "somehow 
pythonish but absolutely not python" language



More information about the Python-list mailing list