ECL technical question

This is a discussion on ECL technical question within the lisp forums in Programming Languages category; Does anyone use the ECL (Embedded Common Lisp) implementation here? I'm interested to know if there's a way to disable the debugger there (I know how to do it in SBCL). Especially when you are building an image, how is it possible to create that image without the debugger? I searched on their site but there is no detailed documentation there. Thanks....

Go Back   Application Development Forum > Programming Languages > lisp

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-20-2008, 11:18 AM
Francogrex
Guest
 
Default ECL technical question

Does anyone use the ECL (Embedded Common Lisp) implementation here?
I'm interested to know if there's a way to disable the debugger there
(I know how to do it in SBCL). Especially when you are building an
image, how is it possible to create that image without the debugger? I
searched on their site but there is no detailed documentation there.
Thanks.
Reply With Quote
  #2  
Old 08-20-2008, 11:37 AM
John Thingstad
Guest
 
Default Re: ECL technical question

På Wed, 20 Aug 2008 17:18:25 +0200, skrev Francogrex <franco@grex.org>:

> Does anyone use the ECL (Embedded Common Lisp) implementation here?
> I'm interested to know if there's a way to disable the debugger there
> (I know how to do it in SBCL). Especially when you are building an
> image, how is it possible to create that image without the debugger? I
> searched on their site but there is no detailed documentation there.
> Thanks.


This is a standard Common Lisp way of sidestepping the debugger.
I don't know of any way to remove the debugger from the ECL image.

(defun alternative-debugger-hook (condition hook)
(declare (ignore hook))
(when (find-restart 'abort condition)
(format t "~%ERROR: ~A~1%" condition)
(abort condition)))

(defun trap-repl-condition (on-off)
(if on-off
(setf *debugger-hook* #'alternative-debugger-hook)
(setf *debugger-hook* nil)))

(trap-repl-condition t)

--------------
John Thingstad
Reply With Quote
  #3  
Old 08-21-2008, 02:38 AM
Francogrex
Guest
 
Default Re: ECL technical question

On Aug 20, 5:37*pm, "John Thingstad" <jpth...@online.no> wrote:
> This is a standard Common Lisp way of sidestepping the debugger.
> I don't know of any way to remove the debugger from the ECL image.
>
> (defun alternative-debugger-hook (condition hook)
> * (declare (ignore hook))
> * (when (find-restart 'abort condition)
> * * (format t "~%ERROR: ~A~1%" condition)
> * * (abort condition)))
>
> (defun trap-repl-condition (on-off)
> * (if on-off
> * * * (setf *debugger-hook* #'alternative-debugger-hook)
> * * (setf *debugger-hook* nil)))
>
> (trap-repl-condition t)


OK thanks, inspired by your code and a little search in google using
some of your keywords I came up with something for ECL specific (I
think) it's below, I share with others.

(defun invoke-debugger/disabled (condition)
(flet ((failure-quit (&key recklessly-p)
(quit)))
(handler-case
(progn
(format *error-output*
"~&~@<unhandled condition (of type ~S):
~2I~_~A~:>~2%"
(type-of condition)
condition)
(finish-output *error-output*)
(format
*error-output*
"~%unhandled condition in --disable-debugger mode, quitting~
%")
(finish-output *error-output*)
(failure-quit))
(condition ()
(ignore-errors
(%primitive print
"Argh! error within --disable-debugger error
handling"))
(failure-quit :recklessly-p t)))))

(defun disable-debugger ()
(setf invoke-debugger #'invoke-debugger/disabled
*debug-io* *error-output*))
(disable-debugger)


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 12:16 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.