mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
remove debug code
This commit is contained in:
parent
5e009cee5a
commit
a3be6d4026
1 changed files with 22 additions and 23 deletions
|
|
@ -3,25 +3,25 @@
|
||||||
;; Lisp code evaluation utilities
|
;; Lisp code evaluation utilities
|
||||||
|
|
||||||
(defun one-of (obj pre choices &optional (title "Error") (prompt "Choice"))
|
(defun one-of (obj pre choices &optional (title "Error") (prompt "Choice"))
|
||||||
(let ((q (format nil "<pre>~A</pre><p style='text-align:left'>" pre))
|
(let ((q (format nil "<pre>~A</pre><p style='text-align:left'>" pre))
|
||||||
(n (length choices)) (i))
|
(n (length choices)) (i))
|
||||||
(do ((c choices (cdr c)) (i 1 (+ i 1)))
|
(do ((c choices (cdr c)) (i 1 (+ i 1)))
|
||||||
((null c))
|
((null c))
|
||||||
(setf q (format nil "~A~&[~D] ~A~%<br>" q i (car c))))
|
(setf q (format nil "~A~&[~D] ~A~%<br>" q i (car c))))
|
||||||
(do () ((typep i `(integer 1 ,n)))
|
(do () ((typep i `(integer 1 ,n)))
|
||||||
(setf q (format nil "~A~&~A:" q prompt))
|
(setf q (format nil "~A~&~A:" q prompt))
|
||||||
(let ((sem (bordeaux-threads:make-semaphore))
|
(let ((sem (bordeaux-threads:make-semaphore))
|
||||||
r)
|
r)
|
||||||
(input-dialog obj q (lambda (result)
|
(input-dialog obj q (lambda (result)
|
||||||
(setf r (or result ""))
|
(setf r (or result ""))
|
||||||
(bordeaux-threads:signal-semaphore sem))
|
(bordeaux-threads:signal-semaphore sem))
|
||||||
:title title
|
:title title
|
||||||
:modal nil
|
:modal nil
|
||||||
:width 640
|
:width 640
|
||||||
:height 480)
|
:height 480)
|
||||||
(bordeaux-threads:wait-on-semaphore sem)
|
(bordeaux-threads:wait-on-semaphore sem)
|
||||||
(setq i (read-from-string r))))
|
(setq i (read-from-string r))))
|
||||||
(nth (- i 1) choices)))
|
(nth (- i 1) choices)))
|
||||||
|
|
||||||
(defun capture-eval (form &key (clog-obj nil) (eval-in-package "clog-user"))
|
(defun capture-eval (form &key (clog-obj nil) (eval-in-package "clog-user"))
|
||||||
"Capture lisp evaluaton of FORM."
|
"Capture lisp evaluaton of FORM."
|
||||||
|
|
@ -33,10 +33,9 @@
|
||||||
(if clog-obj
|
(if clog-obj
|
||||||
(let ((restart (one-of clog-obj condition (compute-restarts))))
|
(let ((restart (one-of clog-obj condition (compute-restarts))))
|
||||||
(when restart
|
(when restart
|
||||||
(print restart)
|
(let ((*debugger-hook* encapsulation))
|
||||||
(let ((*debugger-hook* encapsulation))
|
(invoke-restart-interactively restart))))
|
||||||
(invoke-restart-interactively restart))))
|
(format t "Error - ~A~%" condition))))
|
||||||
(format t "Error - ~A~%" condition))))
|
|
||||||
(unless (stringp form)
|
(unless (stringp form)
|
||||||
(let ((r (make-array '(0) :element-type 'base-char
|
(let ((r (make-array '(0) :element-type 'base-char
|
||||||
:fill-pointer 0 :adjustable t)))
|
:fill-pointer 0 :adjustable t)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue