An experimental Racket library providing an abstraction for values associated with external resources that allows automatic resource pooling, per-thread virtual construction, and monadic composition
(with-disposable ([acquirer disposable-acquire])
(define foo (acquirer foo-disp))
(define bar (acquirer bar-disp))
... do stuff with foo and bar ...)
Essentially, it's a disposable of an "acquirer" - a function that can be used to allocate other disposables. When the acquirer is disposed, all values allocated with it are disposed and all future attempts to call it will fail. This ended up being useful in the implementation of #96.
Bit of a meta idea here:
Essentially, it's a disposable of an "acquirer" - a function that can be used to allocate other disposables. When the acquirer is disposed, all values allocated with it are disposed and all future attempts to call it will fail. This ended up being useful in the implementation of #96.