[Closed] Question about block parameter syntax

Issue #6095 has been updated by Yukihiro M…

Status changed from Open to Closed

fixed by r34835

Feature #6095: Question about block parameter syntax
https://bugs.ruby-lang.org/issues/6095

Author: Koichi Sasada
Status: Closed
Priority: Normal
Assignee:
Category:
Target version:

ささだです.

1.times{
|
x,
y|
}

は通りますが,

1.times{
|
x,
y
|
}

は通りません.閉じる | が行頭に来るのがまずいようです.これは,そういう
もんでしょうか.下記のように,ブロックパラメータにコメント入れようと思っ
て気づきました.

1.times{
|
x, # xxx
y # yyy
| # <- syntax error, unexpected ‘\n’, expecting ‘|’
}


// SASADA Koichi at atdot dot net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs