Skip to content

Instantly share code, notes, and snippets.

@JoelQ
Last active November 10, 2018 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoelQ/f594ad463a4481f0ab48e498a89e558c to your computer and use it in GitHub Desktop.
Save JoelQ/f594ad463a4481f0ab48e498a89e558c to your computer and use it in GitHub Desktop.
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