The recursive-restart Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The recursive-restart Reference Manual

This is the recursive-restart Reference Manual, version 1, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:17:31 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

recursive-restart

Implements several forms for using restarts recursively. The first is recursive-restart-case, which works exactly like CL's native restart-case, except you can invoke the restarts from the restart handlers in a mutually-recursive fashion, such as this:

(let ((invoked-bar nil))
  (recursive-restart-case
       (invoke-restart 'foo)
    (foo ()
       (format t "Invoked FOO.~%")
       (if invoked-bar
           :done
           (invoke-restart 'bar)))
    (bar ()
       (format t "Invoked BAR.~%")
       (setf invoked-bar t)
       (format t "Invoking FOO again...~%")
       (invoke-restart 'foo))))

Also provided is restart-labels, which is a wrapper macro that allows you to specify the handlers before the body, which gains an implicit PROGN. The syntax mirrors that of CL's labels form:

(restart-labels
   ((foo () (format t "Invoked FOO.~%"))
    (bar () (format t "Invoked BAR.~%")))
  (format t "Starting body...~%")
  (invoke-restart 'foo))

restart-bind* is to restart-labels as let* is to let, ie, each handler is wrapped in a new recursive-restart-case.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 recursive-restart

Maintainer

Jeremy Phelps

Author

Jeremy Phelps

License

MIT

Description

Restarts that can invoke themselves.

Long Description

Restarts that can invoke themselves.

Version

1

Dependency

alexandria

Source

recursive-restart.asd (file)

Component

recursive-restart.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 recursive-restart.asd

Location

recursive-restart.asd

Systems

recursive-restart (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 recursive-restart/recursive-restart.lisp

Parent

recursive-restart (system)

Location

recursive-restart.lisp

Packages

recursive-restart

Exported Definitions
Internal Definitions

restart-labels (macro)


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 recursive-restart

Source

recursive-restart.lisp (file)

Use List
Exported Definitions
Internal Definitions

restart-labels (macro)


Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: do-restart BINDINGS &body BODY

A construct that, after a restart is invoked, it jumps to the start and reevaluate the body by default. Example:

(do-restart ((retry (lambda (c) (print :retry)))
(continue (lambda (c) (print :retry))))
(error "error!"))

Package

recursive-restart

Source

recursive-restart.lisp (file)

Macro: handler-bind* BINDINGS &body BODY

Analogous to the relation between let and let*.
In standard handler-bind, the execution of the handler is
’run in a dynamic environment where none of these handler bindings are visible (to avoid recursive errors).’
– (http://www.lispworks.com/documentation/HyperSpec/Body/m_handle.htm)

(handler-bind* ((error (lambda (c) (print :error)))
(my-error (lambda (c) (print :my) (signal c))))
(error ’my-error))

Package

recursive-restart

Source

recursive-restart.lisp (file)

Macro: handler-return BINDINGS &body BODY

The variation of handler-case whose behavior is the same but
the semantics are that of HANDLER-BIND.
Just as HANDLER-CASE, the condition is handled first (that is, it jumps out of the HANDLER-BIND scope with GO) and then
the handler function is called. Finally, HANDLER-RETURN returns
the value of the handler function. Example:

(restart-return ((retry (lambda (c) (print :retry)))
(continue (lambda (c) (print :retry))))
(error "error!"))

is equivalent to:

(restart-case
(error "error!")
(retry (c) (print :retry))
(continue (c) (print :retry)))

Package

recursive-restart

Source

recursive-restart.lisp (file)

Macro: recursive-restart-case VALUE-FORM &rest CASES

RECURSIVE-RESTART-CASE has the same semantics as RESTART-CASE, except you can re-invoke any of the restarts in a mutually recursive fashion. Example:

(let ((invoked-bar nil))
(recursive-restart-case
(invoke-restart ’foo)
(foo ()
(format t "Invoked FOO.~%")
(if invoked-bar
:done
(invoke-restart ’bar)))
(bar ()
(format t "Invoked BAR.~%")
(setf invoked-bar t)
(format t "Invoking FOO again...~%")
(invoke-restart ’foo))))

Package

recursive-restart

Source

recursive-restart.lisp (file)

Macro: restart-bind* BINDINGS &body BODY

Analogous to the relation between let and let*.

(restart-bind* ((retry (lambda (c) (invoke-restart ’continue))) (continue (lambda (c) (print :retry))))
(error "error!"))

Package

recursive-restart

Source

recursive-restart.lisp (file)

Macro: restart-return BINDINGS &body BODY

The variation of restart-case whose behavior is the same but
the semantics are that of RESTART-BIND.
Just as RESTART-CASE, the condition is handled first (that is, it jumps out of the RESTART-BIND scope with GO) and then
the restart function is called. Finally, RESTART-RETURN returns
the value of restart function.

Package

recursive-restart

Source

recursive-restart.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: restart-labels BINDINGS &body BODY
Package

recursive-restart

Source

recursive-restart.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   R  
Index Entry  Section

F
File, Lisp, recursive-restart.asd: The recursive-restart<dot>asd file
File, Lisp, recursive-restart/recursive-restart.lisp: The recursive-restart/recursive-restart<dot>lisp file

L
Lisp File, recursive-restart.asd: The recursive-restart<dot>asd file
Lisp File, recursive-restart/recursive-restart.lisp: The recursive-restart/recursive-restart<dot>lisp file

R
recursive-restart.asd: The recursive-restart<dot>asd file
recursive-restart/recursive-restart.lisp: The recursive-restart/recursive-restart<dot>lisp file

Jump to:   F   L   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   D   H   M   R  
Index Entry  Section

D
do-restart: Exported macros

H
handler-bind*: Exported macros
handler-return: Exported macros

M
Macro, do-restart: Exported macros
Macro, handler-bind*: Exported macros
Macro, handler-return: Exported macros
Macro, recursive-restart-case: Exported macros
Macro, restart-bind*: Exported macros
Macro, restart-labels: Internal macros
Macro, restart-return: Exported macros

R
recursive-restart-case: Exported macros
restart-bind*: Exported macros
restart-labels: Internal macros
restart-return: Exported macros

Jump to:   D   H   M   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   R   S  
Index Entry  Section

P
Package, recursive-restart: The recursive-restart package

R
recursive-restart: The recursive-restart system
recursive-restart: The recursive-restart package

S
System, recursive-restart: The recursive-restart system

Jump to:   P   R   S