doubt with "the pull phase should invoke the transform phase"

38 views
Skip to first unread message

Devices For

unread,
May 29, 2019, 10:12:29 PM5/29/19
to Elements of Clojure
Hello,

On page 108 of the PDF, the sentence "In a robust process, the pull phase should invoke the transform phase." confused me with the "invoke" part in relation to the REPL example shown earlier:

(defn repl [read eval print]
  
(loop []
   
(->> (read)
     
eval
     
print)
  
(recur)))


Assuming this function represents a "robust process" (not a real complete example obviously),  the result of (read), the pull phase, is being passed to eval, the transform phase, as an argument. The pull phase is not invoking eval.

How would the pull phase invoke the transform phase here to make the process more robust?

A probably wrong theory of mine: the meaning of "In a robust process, the pull phase should invoke the transform phase" in this example would mean that the pull phase(read) should invoke eval first to see if it is available to receive data.

Yep, confused ;)
Reply all
Reply to author
Forward
0 new messages