JanetDocsPlaygroundI'm feeling luckyGitHub sign in
(def [pipe-r pipe-w] (os/pipe)) (ev/spawn # write to the pipe in a separate fiber (for i 0 32000 (def str (string "Hello Janet " i "\n")) (:write pipe-w str)) (:close pipe-w)) (forever (def text (:read pipe-r 4096)) (when (nil? text) (break)) (pp text)) # read a series of strings from the pipe in parallel # to writing to the other side, to avoid the program # from hanging if the pipe is "full" # # see https://github.com/janet-lang/janet/issues/1265