# Suggest name for the method

I have an Interpreter class that has a method named loop. This method takes two inputs, a java.io.Reader and a java.io.Writer. Until Reader provides input, it is read, evaluated, and printed to Writer.

For some reason loop does not sound like a good name for this method. I thought of repl but that doesn't sound too good either. What would be a better name for it?

-
Maybe: process –  palacsint Nov 1 '12 at 14:22
Could you name it more along the lines of the functionality it is doing rather than the steps it is taking to achieve the result? –  dreza Nov 2 '12 at 8:37
@palacsint, I have already used that one for something else. :( –  missingfaktor Nov 2 '12 at 9:04
@dreza, it's decoupled from those bits. –  missingfaktor Nov 2 '12 at 9:04

process is possible but a little arbitrary for my taste.

A better option would be pipeAndProcess

I'd just name it readEvalWrite

-
Thank you for the suggestion! I ended up going for a interact, inspired by the function with same name and similar functionality from Haskell stdlib. –  missingfaktor Nov 2 '12 at 9:03
+1 for readEvalWrite. It helps people who look at your code in the future to name things in a similar fashion as to what they are meant do. –  Corv1nus Nov 2 '12 at 13:21

I'd call it readEvaluatePrintLoop, which is the long form of repl. Or even repl ... on the basis that the reader ought to recognize the term and understand what it means.

-
Thank you for the suggestion! I ended up going for a interact, inspired by the function with same name and similar functionality from Haskell stdlib. –  missingfaktor Nov 2 '12 at 9:03