From: matt@... (matt neuburg) Date: 2006-12-24T01:15:05+09:00 Subject: Re: Help with a ruby idiom Tim Waters wrote: > What I don't understand (or > I don't understand how it works is the line: > (@EventDispatcher_listeners[event] ||= []) << callback Here is a verbose a description: @EventDispatcher_listeners is a hash. Look up the entry in that hash, the entry named "event". But perhaps there is no such entry. (The entry is reported as nil.) In that case, create one, and set it to be an empty array. Now you have an array - either the array that was already the "event" entry in the hash, or the empty array that is now the "event" entry in the hash. Append "callback" as the last item of that array. m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Tiger - http://www.takecontrolbooks.com/tiger-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com