[ruby-dev:50846] [Ruby master Feature#7639] More freedom for location of comments

From: sawadatsuyoshi@...
Date: 2019-09-16 12:20:56 UTC
List: ruby-dev #50846
Issue #7639 has been updated by sawa (Tsuyoshi Sawada).


It looks like this feature has been realized by https://bugs.ruby-lang.org/projects/ruby-trunk/repository/git/revisions/3a3f48fb8fbdbb810d9b675159529970015316b9
If I am correct, please close this feature, and thanks, nobu-san.

----------------------------------------
Feature #7639: More freedom for location of comments
https://bugs.ruby-lang.org/issues/7639#change-81559

* Author: sawa (Tsuyoshi Sawada)
* Status: Feedback
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: Next Major
----------------------------------------
=begin
When we chain methods with the period at the end of each line, we can put comments in between the lines:

    [1, 2, 3].
    # First, we do blah blah
    method1.
    # Second, we do blah blah
    method2.
    =begin
      Third, the following line
      does this
      and that ...
    =end
    method3

but when we have the period at the beginning of the line, putting comments in similar positions returns an error:

    [1, 2, 3]
    # First, we do blah blah
    .method1
    # Second, we do blah blah
    .method2
    =begin
      Third, the following line
      does this
      and that ...
    =end
    .method3

    # => Error

It is confusing that putting comments between lines in a method chain is sometimes allowed and sometimes not. I think it would be convenient if comments are allowed in these positions even when the following line starts with a period, and I request this as a feature. Currently, it returns an error, which means that, if such syntax were allowed, there would be no conflict with the existing syntax.

Furthermore, putting the period at the beginning of a line is suited for method chains because the period will visually work as bullets, and it makes more sense to have comments right before those lines.
=end




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next