-
Notifications
You must be signed in to change notification settings - Fork 254
Closed
Description
Description
Using a channel for print operations in runtime evaluation results in strange behaviour.
Steps to Reproduce
- Run this code.
(def c (ev/chan)) (ev/spawn (while (def v (ev/take c)))) (defn print-to-chan [x] (ev/give c x)) (setdyn :out print-to-chan) (def res (eval-string "(defn x [] (pp :foo) (pp :bar) :qux) (x)")) (ev/chan-close c) (setdyn :out nil) (print "Result is " res)
Expected Result
The code outputsResult is qux.
Actual Result
The actual output on my Mac is for the string Result is to appear.
Notes
This is an intentionally contrived example that tries to simplify the problem to its maximum extent. The context in which I came across this is in developing my own evaluation environment for a REPL project I’m working on.
sogaiu
Metadata
Metadata
Assignees
Labels
No labels