goto statement

Grant Edwards grante at visi.com
Thu Apr 21 09:47:47 EDT 2005


On 2005-04-21, Sergei Organov <osv at javad.ru> wrote:

> Well, I'm writing for embedded realtime systems in C/C++ and
> have never encountered a single need to use goto.

I have encountered situations in C programs where the best
thing to use was a goto.  Those situations have always been
handled beutifully by a "raise" in Python.

> Comparing interrupts to goto doesn't make any sense for me
> either. For example, most architectures have 'branch'
> *hardware* instructions that are much more close equivalents
> to goto than interrupts are, but that doesn't justify use of
> goto in high-level languages in any way.

I agree.  The "jump" or "branch" instruction corresponds
exactly to a goto.  An interrupt is more like a "signal" and a
"signal handler" in C.  Sort of like an asynchronous function
call or thread context switch.

-- 
Grant Edwards                   grante             Yow!  Now that we're
                                  at               in LOVE, you can BUY
                               visi.com            this GOLDFISH for a 48%
                                                   DISCOUNT.



More information about the Python-list mailing list