"Thompson, David" <[email protected]> writes: > On Tue, Sep 2, 2014 at 3:03 PM, Carlos Pita <[email protected]> wrote: >> Hi all, although I have some experience with lisps, I'm still new to >> guile and I'm having some trouble figuring out how to invoke the >> interactive debugger at some arbitrary point in my code. Something like: >> >> ; code here >> (debug) >> ; more code here >> >> The closer solution I could find in the manual is: >> >> add-trap-at-source-location! file user-line >> >> Any suggestion? > > I don't know of any straightforward solution, but I would also like > such a feature. I don't think it would be too difficult to write a > 'debug' procedure using the 'debug-trap-handler' procedure in (system > repl error-handling) as inspiration. Basically, you'd need to capture > the current stack and spawn a new REPL in debug mode that uses that > stack.
Couldn't you just use (error)? It will enter the debugger if run from the REPL or otherwise when debugging is enabled on the VM or so (I don't know the details), though it will abort if run stand-alone; not sure if that's enough for your purposes. Taylan
