From: Robert Dober Date: 2008-02-14T00:38:01+09:00 Subject: [RRR] Robert's Ruby Riddle: Local or Method Hi list I was just thinking it might fun to present some of Ruby's features in form of a riddle. There was an interesting thread yesterday and as I always forget the basics I wrote some testcode to find out if the local or the method prevails, I made a stupid error and had to rewrite the code, or maybe did I not? This depends on the answer of the riddle. Todays Ruby Riddle is: Can the following code be used to test if the argument of puts is the local variable "a" or the method "a"? And if so please explain how. a = 42 def a; 42 end puts a I leave some blank lines here so that people can reply without spoiling if for other readers. -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein