Closed lgrapenthin closed 5 years ago
What happens here : hello-world
is run, immediately completes with nil, then the canceller is returned (an instance of Fiber). The REPL tries to find a way to print the canceller, the canceller doesn't know how to print itself, but as it happens to implement IDeref the REPL tries to deref it. deref
ing a sp
Fiber
is a garbage operation so an exception is thrown and then the REPL prints the exception.
Quick workaround : don't print a canceller in a REPL, just define it in a var and maybe call it later.
Long-term solution : implement custom printer methods for cancellers to prevent the REPL to fallback to deref
.
I file it as a bug since it's a major REPL inconvenience.
This results in a fiber which (according to repl print) contains an exception that error fn is invoked with 0 args. If I provide one with 0 args, it is invoked along with the success continuatino.