Ruby REPL
I've been reading the Pragmatic Programmers Guide to Ruby, wishing I had a REPL, when I finally learned enough to write one. For the help of others and future experimentation I now present my Ruby REPL.
while true
'> '.display
gets.each do | e |
puts(eval(e))
end
end
Tags: programming, repl, ruby
Update: At the end of the book they talk about the interactive Ruby shell, irb
. Now, why don't they mention this at the top of every chapter?!
3 Comments:
mike-burns.blogspot.com is very informative. The article is very professionally written. I enjoy reading mike-burns.blogspot.com every day.
payday loans edmonton
cash advance
Since this post is the number one Google hit for "Ruby REPL", I just want to point out to anyone looking for such a thing that it already exists. It is called "IRB" for "Interactive RuBy shell".
Wow. i'm a paid Ruby dev now at some fancy Rails company. Funny how this works out.
... I don't even seem to have my Blogger password anymore.
Post a Comment
<< Home