[ruby-core:71000] Re: limiting scope of magic comments like frozen_string_literal

From: Eric Wong <normalperson@...>
Date: 2015-10-05 23:55:50 UTC
List: ruby-core #71000
"Martin J. D端rst" <duerst@it.aoyama.ac.jp> wrote:
> Hello Eric,
> 
> On 2015/10/05 13:59, Eric Wong wrote:
> >How about being able to limit the scope of magic comments like
> >how the "use" / "no" pragmas work in Perl?
> 
> Ruby was started to fix problems in Perl, not to reintroduce them,
> as far as I understand :-). Reading code in a file with such
> comments at arbitrary places would be quite tough.

OK, maybe not within methods, but perhaps within modules/classes
like private/public/protected keywords

> >It would make refactoring to moving methods to different files/modules
> >easier, I think.
> 
> Well, as far as I understand Matz, the goal is to move towards a
> state where *all* character string literals are frozen. If that's
> the case, then it doesn't make much sense to allow arbitrary
> granularity.

Of course I remain against this incompatible change:
[ruby-core:70528] [ruby-core:70994]

In This Thread

Prev Next