From: Bob Showalter Date: 2007-04-26T22:04:48+09:00 Subject: Re: [SUMMARY] Morse Code (#121) On 4/26/07, Ruby Quiz wrote: > block[prefix] if @@words.nil? || @@words.include?(prefix) I didn't understand that when I first saw it. I kept looking for "yield". Now I see that "block[prefix]" is the same as "yield prefix". Or are there differences? > # returns list of words starting with prefix that can be made from code > def self.words(code = @code, prefix = '') > > (ignore that unused default) Oops. That's a leftover from my original approach that had words as an instance method instead of a class method. > The next line is a usage statement printed by abort(). We don't see that method > too often in quiz solutions, but it prints a message to STDERR, when provided, > and then terminates the program. That's an old Perl'er used to "die()". raise() is so brutal for this kind of thing :~)