From: Avdi Grimm Date: 2013-09-30T10:40:12-04:00 Subject: [ruby-core:57495] Re: [ruby-trunk - Feature #8839] Class and module should return the class or module that was opened --001a11c3dfba7cc37904e79ad1a7 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Sep 28, 2013 at 2:39 AM, shugo (Shugo Maeda) wrote: > For example, bootstraptest/test_block.rb uses the last value of a class > definition as follows: The only time I've ever used the return value of a class definition it's been to get the class itself, by making `self` the last statement in the class definition. That said, if you really wanted to preserve the ability to return something other from a class definition, could you make `break ` override the return, as it does in blocks? -- Avdi Grimm http://avdi.org I only check email twice a day. to reach me sooner, go to http://awayfind.com/avdi --001a11c3dfba7cc37904e79ad1a7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= On Sat, Sep 28, 2013 at 2:39 AM, shugo (Shugo Maeda) <= redmine@ruby-lan= g.org> wrote:
For example, bootstraptest/test_block.rb use= s the last value of a class definition as follows:

Th= e only time I've ever used the return value of a class definition it= 9;s been to get the class itself, by making `self` the last statement in th= e class definition.

That said, = if you really wanted to preserve the ability to return something other from= a class definition, could you make `break <SOME_VALUE>` override the= return, as it does in blocks?

--
Avdi Grimm
http://avdi.org

I only check email twice a day. to reach = me sooner, go to htt= p://awayfind.com/avdi
--001a11c3dfba7cc37904e79ad1a7--