diff --git a/collects/scribblings/reference/futures.scrbl b/collects/scribblings/reference/futures.scrbl index cf65a29323..a612a637e5 100644 --- a/collects/scribblings/reference/futures.scrbl +++ b/collects/scribblings/reference/futures.scrbl @@ -66,6 +66,13 @@ in parallel. See also @guidesecref["effective-futures"]. (let ([f (future (lambda () (+ 1 2)))]) (list (+ 3 4) (touch f))) ]} + + +@defproc[(current-future) any]{ + Returns the descriptor for the future that is evaluating the current thunk. + If not currently running inside a future thunk (or + futures are disabled), returns @racket[#f]. +} @defproc[(future? [v any/c]) boolean?]{ diff --git a/collects/tests/future/future.rkt b/collects/tests/future/future.rkt index 7c657fb609..dbcc24eb14 100644 --- a/collects/tests/future/future.rkt +++ b/collects/tests/future/future.rkt @@ -149,8 +149,7 @@ We should also test deep continuations. (continuation-mark-set->list (current-continuation-marks) 'x)))) ;Tests for current-future -(check-equal? '() (current-future)) -(check-equal? #t (null? (current-future))) +(check-equal? #f (current-future)) (check-equal? #t (equal? (current-future) (current-future))) (let ([f (future (λ () (current-future)))])