ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:51003] [Ruby master Feature#17598] 直後の改行を無視する命令(......)
       [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
@ 2021-01-30 13:17 ` nobu
  2021-01-30 14:54   ` [ruby-dev:51004] " 服部-
  2021-01-30 15:15 ` [ruby-dev:51006] " sawadatsuyoshi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 6+ messages in thread
From: nobu @ 2021-01-30 13:17 UTC (permalink / raw)
  To: ruby-dev

Issue #17598 has been updated by nobu (Nobuyoshi Nakada).

Description updated

「命令」というよりは構文要素、トークンだと思います。

----------------------------------------
Feature #17598: 直後の改行を無視する命令(......)
https://bugs.ruby-lang.org/issues/17598#change-90179

* Author: Anonymous
* Status: Open
* Priority: Normal
----------------------------------------
改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。

```ruby
(0... ......
5).each ......
.map{_1} ...... # some comments
=> ar
# (0...5).each.map{_1} => ar
```

(1) 本当は `...` が一番良いと思います。しかし Range で使われています。
(2) 一番良いのが使えないなら長くしよう。 `......`
(3) 実際に使うのなら `....` が妥当?
(4) `....` と `......` の両方作っちゃえ。

私は実験的に (2) を希望します。



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-dev:51004] Re: [Ruby master Feature#17598] 直後の改行を無視する命令(......)
  2021-01-30 13:17 ` [ruby-dev:51003] [Ruby master Feature#17598] 直後の改行を無視する命令(......) nobu
@ 2021-01-30 14:54   ` 服部-
  0 siblings, 0 replies; 6+ messages in thread
From: 服部- @ 2021-01-30 14:54 UTC (permalink / raw)
  To: ruby-dev

[-- Attachment #1: Type: text/plain, Size: 1981 bytes --]

`......` は長過ぎると思ったので取り止めます。


(1) `--`

読みやすく書きやすい。`  --`と手前にスペースを2つが読みやすくてオススメ? (×) Ruby
では使われていないが、デクリメントが使えなくなる。(イテレータ用?)

(2) `"\\;"`

改行のエスケープと意味が分かりやすい。 `"\\\n"` と似ている。 (×)
斜めの線が入って読みにくい?単一の記号の連続の方がタイプしやすい?スクリプト言語っぽくない??

(3) `....` (4文字ドット)

見た目から意味を推測しやすい。 (×) 4文字は長い。3文字 `...` はRange や任意個の引数のようにすでに多くの記号に使われている。


この案の中では (1) が良いと思います。


2021年1月30日(土) 22:17 <nobu@ruby-lang.org>:

> Issue #17598 has been updated by nobu (Nobuyoshi Nakada).
>
> Description updated
>
> 「命令」というよりは構文要素、トークンだと思います。
>
> ----------------------------------------
> Feature #17598: 直後の改行を無視する命令(......)
> https://bugs.ruby-lang.org/issues/17598#change-90179
>
> * Author: Anonymous
> * Status: Open
> * Priority: Normal
> ----------------------------------------
> 改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。
>
> ```ruby
> (0... ......
> 5).each ......
> .map{_1} ...... # some comments
> => ar
> # (0...5).each.map{_1} => ar
> ```
>
> (1) 本当は `...` が一番良いと思います。しかし Range で使われています。
> (2) 一番良いのが使えないなら長くしよう。 `......`
> (3) 実際に使うのなら `....` が妥当?
> (4) `....` と `......` の両方作っちゃえ。
>
> 私は実験的に (2) を希望します。
>
>
>
> --
> https://bugs.ruby-lang.org/
>

[-- Attachment #2: Type: text/html, Size: 4959 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-dev:51006] [Ruby master Feature#17598] 直後の改行を無視する命令(......)
       [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
  2021-01-30 13:17 ` [ruby-dev:51003] [Ruby master Feature#17598] 直後の改行を無視する命令(......) nobu
@ 2021-01-30 15:15 ` sawadatsuyoshi
  2021-01-30 15:18 ` [ruby-dev:51007] " sawadatsuyoshi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: sawadatsuyoshi @ 2021-01-30 15:15 UTC (permalink / raw)
  To: ruby-dev

Issue #17598 has been updated by sawa (Tsuyoshi Sawada).


提示された例が良くないと思います。例示された例は、 `......` がなくても、そのまま動きます。

----------------------------------------
Feature #17598: 直後の改行を無視する命令(......)
https://bugs.ruby-lang.org/issues/17598#change-90182

* Author: Anonymous
* Status: Open
* Priority: Normal
----------------------------------------
改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。

```ruby
(0... ......
5).each ......
.map{_1} ...... # some comments
=> ar
# (0...5).each.map{_1} => ar
```

(1) 本当は `...` が一番良いと思います。しかし Range で使われています。
(2) 一番良いのが使えないなら長くしよう。 `......`
(3) 実際に使うのなら `....` が妥当?
(4) `....` と `......` の両方作っちゃえ。

私は実験的に (2) を希望します。



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-dev:51007] [Ruby master Feature#17598] 直後の改行を無視する命令(......)
       [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
  2021-01-30 13:17 ` [ruby-dev:51003] [Ruby master Feature#17598] 直後の改行を無視する命令(......) nobu
  2021-01-30 15:15 ` [ruby-dev:51006] " sawadatsuyoshi
@ 2021-01-30 15:18 ` sawadatsuyoshi
  2021-02-01  5:48 ` [ruby-dev:51008] " hattorihiroaki318
  2021-02-03  1:13 ` [ruby-dev:51011] " nobu
  4 siblings, 0 replies; 6+ messages in thread
From: sawadatsuyoshi @ 2021-01-30 15:18 UTC (permalink / raw)
  To: ruby-dev

Issue #17598 has been updated by sawa (Tsuyoshi Sawada).


行末の `\` を `......` に置き換えて何が良いのでしょうか。私は行末の `\` のほうが見やすいと思います。

----------------------------------------
Feature #17598: 直後の改行を無視する命令(......)
https://bugs.ruby-lang.org/issues/17598#change-90183

* Author: Anonymous
* Status: Open
* Priority: Normal
----------------------------------------
改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。

```ruby
(0... ......
5).each ......
.map{_1} ...... # some comments
=> ar
# (0...5).each.map{_1} => ar
```

(1) 本当は `...` が一番良いと思います。しかし Range で使われています。
(2) 一番良いのが使えないなら長くしよう。 `......`
(3) 実際に使うのなら `....` が妥当?
(4) `....` と `......` の両方作っちゃえ。

私は実験的に (2) を希望します。



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-dev:51008] [Ruby master Feature#17598] 直後の改行を無視する命令(......)
       [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2021-01-30 15:18 ` [ruby-dev:51007] " sawadatsuyoshi
@ 2021-02-01  5:48 ` hattorihiroaki318
  2021-02-03  1:13 ` [ruby-dev:51011] " nobu
  4 siblings, 0 replies; 6+ messages in thread
From: hattorihiroaki318 @ 2021-02-01  5:48 UTC (permalink / raw)
  To: ruby-dev

Issue #17598 has been updated by hattorihiroaki318 (裕暁 服部).


私の最終提案です。

改行の無視は前の行のインデントより4文字以上深い行でします。
これを避けるには空白文字だけの(コメントもない)空行を2行以上入れます。1行だけだと改行無視をします。

```ruby
3.times.map{_1}
    => ar  # => [0,1,2]
3.times.map{_1}

    => ar  # => [0,1,2]
3.times.map{_1}


    => ar  # => Error
3.times.map{_1}
      # -- comments --

    => ar  # => [0,1,2]
3.times.map{_1}
      # -- comments --


    => ar  # => Error
```


----------------------------------------
Feature #17598: 直後の改行を無視する命令(......)
https://bugs.ruby-lang.org/issues/17598#change-90198

* Author: Anonymous
* Status: Open
* Priority: Normal
----------------------------------------
改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。

```ruby
(0... ......
5).each ......
.map{_1} ...... # some comments
=> ar
# (0...5).each.map{_1} => ar
```

(1) 本当は `...` が一番良いと思います。しかし Range で使われています。
(2) 一番良いのが使えないなら長くしよう。 `......`
(3) 実際に使うのなら `....` が妥当?
(4) `....` と `......` の両方作っちゃえ。

私は実験的に (2) を希望します。



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-dev:51011] [Ruby master Feature#17598] 直後の改行を無視する命令(......)
       [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2021-02-01  5:48 ` [ruby-dev:51008] " hattorihiroaki318
@ 2021-02-03  1:13 ` nobu
  4 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2021-02-03  1:13 UTC (permalink / raw)
  To: ruby-dev

Issue #17598 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Feedback

これがあると何がどう嬉しいのでしょうか。
少なくともインデントルールをrubyに導入するのはかなり困難だと思います。慣習的にも実装的にも。

----------------------------------------
Feature #17598: 直後の改行を無視する命令(......)
https://bugs.ruby-lang.org/issues/17598#change-90251

* Author: Anonymous
* Status: Feedback
* Priority: Normal
----------------------------------------
改行を無視する命令、今 `\(\n)` となっている命令についてです。 `......` を提案します。

```ruby
(0... ......
5).each ......
.map{_1} ...... # some comments
=> ar
# (0...5).each.map{_1} => ar
```

(1) 本当は `...` が一番良いと思います。しかし Range で使われています。
(2) 一番良いのが使えないなら長くしよう。 `......`
(3) 実際に使うのなら `....` が妥当?
(4) `....` と `......` の両方作っちゃえ。

私は実験的に (2) を希望します。



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-03  1:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-17598.20210130131356.2@ruby-lang.org>
2021-01-30 13:17 ` [ruby-dev:51003] [Ruby master Feature#17598] 直後の改行を無視する命令(......) nobu
2021-01-30 14:54   ` [ruby-dev:51004] " 服部-
2021-01-30 15:15 ` [ruby-dev:51006] " sawadatsuyoshi
2021-01-30 15:18 ` [ruby-dev:51007] " sawadatsuyoshi
2021-02-01  5:48 ` [ruby-dev:51008] " hattorihiroaki318
2021-02-03  1:13 ` [ruby-dev:51011] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).