Monday, June 27, 2005

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

A Do Not Enter sign above a Dead End sign

Tags: , ,

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:

Anonymous Anonymous said...

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

Monday, November 23, 2009 11:07:00 PM  
Anonymous Jon Rodriguez said...

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".

Friday, October 22, 2010 4:07:00 AM  
Anonymous Anonymous said...

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.

Friday, October 22, 2010 7:40:00 AM  

Post a Comment

<< Home