Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
b03fe37e
Commit
b03fe37e
authored
31 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Use WITH-CONDITION-RESTARTS in CERROR.
parent
4826bc5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/error.lisp
+5
-71
5 additions, 71 deletions
code/error.lisp
with
5 additions
and
71 deletions
code/error.lisp
+
5
−
71
View file @
b03fe37e
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.2
4
1993/07/0
2
1
5
:0
6
:3
3
ram Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.2
5
1993/07/0
3
1
7
:0
8
:3
2
ram Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -215,73 +215,6 @@
'
())))))
#|
This hack of using catch w/ conses should no longer be necessary...
(defmacro restart-case (expression &body clauses)
"(RESTART-CASE form
{(case-name arg-list {keyword value}* body)}*)
The form is evaluated in a dynamic context where the clauses have special
meanings as points to which control may be transferred (see INVOKE-RESTART).
When clauses contain the same case-name, FIND-RESTART will find the first
such clause."
(flet ((transform-keywords (&key report interactive)
(let ((result '()))
(when report
(setq result (list* (if (stringp report)
`#'(lambda (stream)
(write-string ,report stream))
`#',report)
:report-function
result)))
(when interactive
(setq result (list* `#',interactive
:interactive-function
result)))
(nreverse result))))
(let ((temp-var (gensym))
(outer-tag (gensym))
(inner-tag (gensym))
(tag-var (gensym))
(data
(mapcar #'(lambda (clause)
(with-keyword-pairs ((report interactive &rest forms)
(cddr clause))
(list (car clause) ;name=0
(gensym) ;tag=1
(transform-keywords :report report ;keywords=2
:interactive interactive)
(cadr clause) ;bvl=3
forms))) ;body=4
clauses)))
`(let ((,outer-tag (cons nil nil))
(,inner-tag (cons nil nil))
,temp-var ,tag-var)
(catch ,outer-tag
(catch ,inner-tag
(throw ,outer-tag
(restart-bind
,(mapcar #'(lambda (datum)
(let ((name (nth 0 datum))
(tag (nth 1 datum))
(keys (nth 2 datum)))
`(,name #'(lambda (&rest temp)
(setf ,temp-var temp)
(setf ,tag-var ',tag)
(throw ,inner-tag nil))
,@keys)))
data)
,expression)))
(case ,tag-var
,@(mapcar #'(lambda (datum)
(let ((tag (nth 1 datum))
(bvl (nth 3 datum))
(body (nth 4 datum)))
`(,tag
(apply #'(lambda ,bvl ,@body) ,temp-var))))
data)))))))
|#
(
eval-when
(
compile
load
eval
)
;;; Wrap the restart-case expression in a with-condition-restarts if
;;; appropriate. Gross, but it's what the book seems to say...
...
...
@@ -671,9 +604,10 @@ This hack of using catch w/ conses should no longer be necessary...
(
setf
(
error-function-name
condition
)
name
))
(
unless
debug:*stack-top-hint*
(
setf
debug:*stack-top-hint*
frame
))))
(
let
((
debug:*stack-top-hint*
nil
))
(
signal
condition
))
(
invoke-debugger
condition
))))
(
with-condition-restarts
condition
(
list
(
find-restart
'continue
))
(
let
((
debug:*stack-top-hint*
nil
))
(
signal
condition
))
(
invoke-debugger
condition
)))))
nil
)
(
defun
break
(
&optional
(
datum
"Break"
)
&rest
arguments
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment