diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-29 06:46:05 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-29 06:46:05 -0700 |
commit | 2764d8e78d0d72f7c0d8fcc4e41cf4df41017026 (patch) | |
tree | 4e6a9264ad0261282fd5bee6c6f7d47da798c35a /txr.1 | |
parent | d651ee10089e684686d9255e6f479fa16c7576db (diff) | |
download | txr-2764d8e78d0d72f7c0d8fcc4e41cf4df41017026.tar.gz txr-2764d8e78d0d72f7c0d8fcc4e41cf4df41017026.tar.bz2 txr-2764d8e78d0d72f7c0d8fcc4e41cf4df41017026.zip |
Finalize obtain continuator function.
* share/txr/stdlib/yield.tl (sys:obtain-impl): Add a finalizer
to the returned closure which will feed sys:cont-poison object
to the most recently captured continuation. Thus abandoned
obtain blocks which have become garbage shall have their
unwinding performed.
* txr.1: Documented the finalization behavior.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -27669,6 +27669,16 @@ if it is an ordinary value, it is returned; otherwise, if it is a yield object, its stored value is returned and the state is updated with the new yield object's continuation. +The +.code obtain +macro registers a finalizer against the returned function. +The finalizer invokes the function, passing it the symbol +.codn sys:cont-poison , +thereby triggering unwinding in the most recently captured +continuation. Thus, abandoned +.code obtain +blocks are subject to unwinding when they become garbage. + .TP* Notes: These macros provide a simple abstraction for the use of continuations. |