Skip to content

Instantly share code, notes, and snippets.

@alebaffa
Created March 13, 2014 20:55
Show Gist options
  • Save alebaffa/9536826 to your computer and use it in GitHub Desktop.
Save alebaffa/9536826 to your computer and use it in GitHub Desktop.
Week 5 - Challange 1. Implement a very simple REPL for Ruby.
# simple_repl.rb
# This program replicate a very simple REPL for Ruby.
def prompt
print '>>'
user_input = gets.chomp!
puts("=> #{eval(user_input)}")
end
loop do
prompt
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment