From: Dave Lenhardt Date: 2008-09-21T07:29:39+09:00 Subject: Re: Explaination of a bit of code Thanks all. I should note that these are not my programs but snippets from a book (Programming Guide to Ruby) that I am trying to make sure I understand. Here's another snippet I am wondering on: catch (:done) do while line = gets throw :done unless fields = line.split(/\t/) songlist.add(Song.new(*fields)) end songlist.play end So, according to the book, it's looking for badly formatted strings. If there is a badly formatted string, the throw clause is invoked. Now, the question is, where does the throw clause go. I see that catch (:done) is right there, but how does the throw clause "find" the catch clause. In other words, I am trying to understand howt his works compared to... while line = gets throw :done unless fields = line.split (/\t/) songlist.add(Song.new(*fields)) end end catch :done #handle issues end -- Posted via http://www.ruby-forum.com/.