[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ruby-mode] Private/protected method definition layout in Ruby 2.1

From: Dmitry Gutov
Subject: Re: [ruby-mode] Private/protected method definition layout in Ruby 2.1
Date: Thu, 16 Jan 2014 20:40:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 16.01.2014 16:26, Bozhidar Batsov wrote:
By "current implementation" I meant the current patch. Yeah, I think
that some way to have defs align to the start of an expression only for
modifier expressions might be a good idea in the interest of maximum

They are plain method calls anyway. Like mentioned, `private', etc, are not keywords.

I meant to say that in
the current implementation of the feature in MRI assigning the result to
a variable doesn't make much sense, but in the future that might change
(if the return value becomes a method object instead of a symbol).

I don't think it's likely to change. Previously, the return value was undefined. Now that it's specified to be method name symbol, it probably won't ever change, in the interests of backward compatibility.

In Rubinius defs have always returned an object:

def foo; end
=> #<Rubinius::CompiledMethod foo file=(irb)>

Ah, I see. It's probably considered an implementation detail, though.

Anyways, I think that the current patch will be good enough for most
users. I was just pointing out some potential problems in case they were
overlooked by you.

Thanks, but the occasional need for more flexibility is often apparent. The question I'm usually trying to answer is whether we can get away with fewer options, and still keep users happy.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]