Bill Allombert on Wed, 15 Feb 2012 13:41:58 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: breakpoint |
On Wed, Feb 15, 2012 at 11:12:30AM +0100, Andreas Enge wrote: > Hi Bill, > > On Mon, Feb 13, 2012 at 12:20:16AM +0100, Bill Allombert wrote: > > We have discussed the implementation of a breakpoint in GP. > > In its simplest form the implementation is as follow: > > void pari_breakpoint(void) { cb_pari_sigint(); } > > and the relevant file in src/functions/programming. > > > > You insert a call to breakpoint() somewhere in your GP program, and when reached, > > this simulate a SIGINT (control-C) which cause GP to enter the breakloop and > > allow you to inspect the state of the program, and allow you to quit the breakloop > > and continue to run the program. > > this sounds good; however, if pari_breakpoint is simply a call to cb_pari_sigint, > the latter function already does the job, or am I missing something? Then it would > only be a matter of exporting it to gp under the name of breakpoint. cb_pari_sigint() is a pointer to a function, not a function. What pari_breakpoint does is dereferencing it. > > Maybe we should allow: > > breakpoint(x): only stop if x is true. > > but this is not much nicer than if(x,breakpoint()). > > Agreed, the latter seems enough. Did you try to use this feature ? Cheers, Bill.