Skip to content

Commit b6de535

Browse files
committed
Adding document for call-with-continuation-barrier
1 parent 35b65d7 commit b6de535

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/sagittarius/continuations.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,27 @@ Otherwise generates one.
9393
###### [!Function] `default-continuation-prompt-tag`
9494

9595
Returns a default continuation prompt tag.
96+
97+
###### [!Function] `call-with-continuation-barrier` _thunk_
98+
99+
Installs a continuation barrier and call _thunk_.
100+
101+
A continuation barrier prevents jumps into more deeply nested active
102+
procedure calls:
103+
104+
```scheme
105+
((call-with-continuation-barrier
106+
(lambda ()
107+
(call/cc values))))
108+
```
109+
110+
If a continuation is captured outside of the barrier and escaping
111+
from the _thunk_, it's okay
112+
113+
```scheme
114+
(call/cc
115+
(lambda (k)
116+
(call-with-continuation-barrier
117+
(lambda ()
118+
(k 'ok)))))
119+
```

0 commit comments

Comments
 (0)