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
89fdfe3e
Commit
89fdfe3e
authored
31 years ago
by
ram
Browse files
Options
Downloads
Patches
Plain Diff
Changed uses of RESTART-CASE to be detectable calls to error.
parent
ebc3317f
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/macros.lisp
+30
-30
30 additions, 30 deletions
code/macros.lisp
with
30 additions
and
30 deletions
code/macros.lisp
+
30
−
30
View file @
89fdfe3e
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.4
0
1993/0
6/24 12:55
:2
5
ram Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.4
1
1993/0
7/02 15:12
:2
7
ram Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1280,19 +1280,18 @@
places
)))
(
defun
assert-error
(
test-form
places
datum
&rest
arguments
)
(
restart-case
(
if
datum
(
apply
#'
error
datum
arguments
)
(
simple-assertion-failure
test-form
))
(
let
((
cond
(
if
datum
(
conditions::coerce-to-condition
datum
arguments
'simple-error
'error
)
(
make-condition
'simple-error
:format-control
"The assertion ~S failed."
:format-arguments
(
list
assertion
)))))
(
restart-case
(
error
cond
)
(
continue
()
:report
(
lambda
(
stream
)
(
assert-report
places
stream
))
nil
)))
nil
)))
)
(
defun
simple-assertion-failure
(
assertion
)
(
error
'simple-type-error
:datum
assertion
:expected-type
nil
;this needs some work in next revision. -kmp
:format-control
"The assertion ~S failed."
:format-arguments
(
list
assertion
)))
(
defun
assert-report
(
names
stream
)
(
format
stream
"Retry assertion"
)
...
...
@@ -1333,25 +1332,26 @@
(
check-type-error
',place
,
place-value
',type
,
type-string
))))))
(
defun
check-type-error
(
place
place-value
type
type-string
)
(
restart-case
(
if
type-string
(
error
'simple-type-error
:datum
place
:expected-type
type
:format-control
"The value of ~S is ~S, which is not ~A."
:format-arguments
(
list
place
place-value
type-string
))
(
error
'simple-type-error
:datum
place
:expected-type
type
:format-control
"The value of ~S is ~S, which is not of type ~S."
:format-arguments
(
list
place
place-value
type
)))
(
store-value
(
value
)
:report
(
lambda
(
stream
)
(
format
stream
"Supply a new value of ~S."
place
))
:interactive
read-evaluated-form
value
)))
(
let
((
cond
(
if
type-string
(
make-condition
'simple-type-error
:datum
place
:expected-type
type
:format-control
"The value of ~S is ~S, which is not ~A."
:format-arguments
(
list
place
place-value
type-string
))
(
make-condition
'simple-type-error
:datum
place
:expected-type
type
:format-control
"The value of ~S is ~S, which is not of type ~S."
:format-arguments
(
list
place
place-value
type
)))))
(
restart-case
(
error
cond
)
(
store-value
(
value
)
:report
(
lambda
(
stream
)
(
format
stream
"Supply a new value of ~S."
place
))
:interactive
read-evaluated-form
value
))))
;;; READ-EVALUATED-FORM is used as the interactive method for restart cases
;;; setup by the Common Lisp "casing" (e.g., CCASE and CTYPECASE) macros
...
...
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