mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-31 09:20:23 +02:00
(Dynamic Wind): Reformat example a bit to avoid
going off the right edge of the paper. Reported by Percy Tiglao.
This commit is contained in:
parent
bcbecaf7fd
commit
4d84f173ef
1 changed files with 18 additions and 17 deletions
|
@ -1234,28 +1234,29 @@ non-locally, @var{out_guard} is called. If the dynamic extent of
|
||||||
the dynamic-wind is re-entered, @var{in_guard} is called. Thus
|
the dynamic-wind is re-entered, @var{in_guard} is called. Thus
|
||||||
@var{in_guard} and @var{out_guard} may be called any number of
|
@var{in_guard} and @var{out_guard} may be called any number of
|
||||||
times.
|
times.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(define x 'normal-binding)
|
(define x 'normal-binding)
|
||||||
@result{} x
|
@result{} x
|
||||||
(define a-cont (call-with-current-continuation
|
(define a-cont
|
||||||
(lambda (escape)
|
(call-with-current-continuation
|
||||||
(let ((old-x x))
|
(lambda (escape)
|
||||||
(dynamic-wind
|
(let ((old-x x))
|
||||||
;; in-guard:
|
(dynamic-wind
|
||||||
;;
|
;; in-guard:
|
||||||
(lambda () (set! x 'special-binding))
|
;;
|
||||||
|
(lambda () (set! x 'special-binding))
|
||||||
|
|
||||||
;; thunk
|
;; thunk
|
||||||
;;
|
;;
|
||||||
(lambda () (display x) (newline)
|
(lambda () (display x) (newline)
|
||||||
(call-with-current-continuation escape)
|
(call-with-current-continuation escape)
|
||||||
(display x) (newline)
|
(display x) (newline)
|
||||||
x)
|
x)
|
||||||
|
|
||||||
;; out-guard:
|
|
||||||
;;
|
|
||||||
(lambda () (set! x old-x)))))))
|
|
||||||
|
|
||||||
|
;; out-guard:
|
||||||
|
;;
|
||||||
|
(lambda () (set! x old-x)))))))
|
||||||
;; Prints:
|
;; Prints:
|
||||||
special-binding
|
special-binding
|
||||||
;; Evaluates to:
|
;; Evaluates to:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue