Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | close-stream: new : protocol from close method. | Kaz Kylheku | 2023-08-07 | 1 | -1/+4 |
| | | | | | | | | | | | | | * stream.c (close_stream): If the underlying method returns the colon symbol :, then keep the cached close_result as nil, so that the method can be called again, but return t to the caller to indicate success. * tests/018/close-delegate.tl: Test case added. * tests/018/close-delegate.expected: Updated. * txr.1: Documented. | ||||
* | streams: close-stream only caches non-nil result. | Kaz Kylheku | 2023-08-07 | 1 | -0/+3 |
This is motivated by trying to implement a struct delegate stream which performs reference counting in close, in order to close the real stream when the count hits zero. The caching behavior of close-stream is a problem. * stream.c (strm_base_init): Initialize close_result to nil, rather than nao. (strm_base_mark): Don't check close_result for nao. (close_stream): Suppress the call to op->close if close_result has a non-nil value, rather than a value other than nao. * tests/018/close-delegate.tl, * tests/018/close-delegate.expected: New files. * txr.1: Document that only a non-nil return is cached by close-stream. |