Skip to content

Instantly share code, notes, and snippets.

Last active Nov 10, 2018
What would you like to do?
4-line Ruby REPL (read eval print loop)
puts "4 line REPL (read eval print loop)"
$stdin.each_line do |line| # READ
return_value = eval(line.chomp) # EVAL
puts return_value # PRINT
end # LOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment