From octave-maintainers-request at bevo dot che dot wisc dot edu Mon Sep 1 20:13:47 2003 Subject: Re: How to return to top level and release memory From: pkienzle at users dot sourceforge dot net To: octave-maintainers at bevo dot che dot wisc dot edu Date: Mon, 01 Sep 2003 21:15:27 +0100 On 30 Aug 2003 at 20:38, Andy Adler wrote: > > We use exceptions for this purpose now when handling interrupts. > > Inside the interrupt handler, we set a flag (octave_interrupt_state) > > and then throughout the rest of Octave we have the OCTAVE_QUIT macro, > > which expands to > > > > do > > { > > if (octave_interrupt_state) > > { > > octave_interrupt_state = 0; > > octave_throw_interrupt_exception (); > > } > > } > > while (0) > > Just for my curiosity, why is the "do {} while(0)" necessary? > Wouldn't a bare block have the same effect? The following is a syntax error if OCTAVE_QUIT is a bare block: if (condition) OCTAVE_QUIT; else break; Paul Kienzle pkienzle at users dot sf dot net