# File lib/bus_scheme.rb, line 35
  def self.repl
    loop do
      puts begin
             input = Readline.readline(PROMPT)
             exit if input.nil? # only Ctrl-D produces nil here it seems
             begin # allow for multiline input
               BusScheme.eval_string(input).inspect
             rescue IncompleteError
               input += "\n" + Readline.readline(INCOMPLETE_PROMPT)
               retry
             end
           rescue Interrupt
             'Type "(quit)" or press Ctrl-D to leave Bus Scheme.'
           rescue BusSchemeError => e
             "Error: #{e}"
           rescue StandardError => e
             "You found a bug in Bus Scheme!\n" +
               "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
           end
    end
  end