From: nobu.nokada@... Date: 2003-06-07T13:19:45+09:00 Subject: Re: What should "class ... end" and "def ... end" return? Hi, At Sat, 7 Jun 2003 13:08:40 +0900, you CAN teach an old dog ... wrote: > Are they expressions? If not, why not? "class" returns last value, and "def" returns nil in 1.8. $ ruby -ve 'p(class X;true;end, def x;true;end)' ruby 1.8.0 (2003-06-06) [i686-linux] -e:1: warning: void value expression -e:1: warning: void value expression true nil # Hmmm, the warning for "class" doesn't seem appropriate. > It would be nice if they returned a Class and an (Unbound)Method > respectively. It makes it possible to do various modifier-like things > at the point of definition, instead of using symbol lookups > subsequently. If you mean Module#public, #private and so on, it should be a Symbol for "def". -- Nobu Nakada