JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

fiber/last-value

core-api


    cfunction
    src/core/fiber.c on line 664, column 1

    (fiber/last-value fiber)

    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