Skip to content

Instantly share code, notes, and snippets.

@JoelQ
Last active Nov 10, 2018
Embed
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