summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-11-12 16:15:58 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-11-12 16:17:41 +0900
commit14db635097ef89a299531770ba8ed5800a58ab8f (patch)
tree0eda7262f7335a8d9e201c808ecebb02d959a5da /NEWS
parentb0fb9bda9ade532da9012c375c0026470484a346 (diff)
add NEWS about _1 as a local variable [ci skip]
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS5
1 files changed, 5 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index fd1759956b..244d5abd11 100644
--- a/NEWS
+++ b/NEWS
@@ -126,6 +126,11 @@ sufficient information, see the ChangeLog file or Redmine
[1, 2, 10].map { _1.to_s(16) } #=> ["1", "2", "a"]
+ You can still define a local variable named _1 and so on, and that is honored when present, but renders warning.
+
+ _1 = 0
+ [1].each { p _1 } # prints 0 instead of 1, but also warns.
+
==== proc/lambda without block is deprecated
* Proc.new and Kernel#proc with no block in a method called with a block is