JanetDocsPlaygroundI'm feeling luckyGitHub sign in

fiber/last-value



    cfunction

    (fiber/last-value

    Get the last value returned or signaled from the fiber.


2 examplesSign in to add an example
Loading...
(def f (ev/spawn 4))
(ev/sleep 0.0001) # give ev a chance in the REPL, remove in file
(fiber/last-value f) # => 4
pepePlayground
(def f (fiber/new (fn [] (yield 2) 3)))
(pp (resume f)) # => 2
(resume f)
(pp (fiber/last-value f)) # => 3
pepePlayground