define loop statement?

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Thu Feb 16 16:03:31 EST 2006


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 :-)

-- 
René Pijlman



More information about the Python-list mailing list