August 12, 2003
Yes, Ruby is Cool. I have the privilege of getting to chat every month or so with DaveThomas, who co-authored ProgrammingRuby. He just did a presentation at OSCON and temporarily posted his slides from the talk. I've been using Ruby for about 2 years now, but I still like to review stuff like this to see if I'm missing any nuggets. And besides, Dave is rather good at putting things. Here's a lovely snippet that hit my blogging nerve:
nagger = do
loop { sleep 2; puts "Hurry up!" }

puts "What is the cube root of 753171?"

timeout(10) do
loop do
answer = gets
exit if answer.to_i == 91
puts "Nope!"

puts "Too bad"

see also SubHashForArrayExample

tags: ComputersAndTechnology
comments powered by Disqus