From: x3qt.dev@... Date: 2020-06-11T10:46:40+00:00 Subject: [ruby-core:98739] [Ruby master Feature#16939] Alias _1 as _ for block numbered params Issue #16939 has been updated by x3qt (Yury Polyakov). matz (Yukihiro Matsumoto) wrote in #note-2: > It was the first candidate for a single anonymous block parameter. But we abandoned for the compatibility's sake. Too many existing programs use `_` as a local variable (far too more than `_1`). > > We'd be happy to be proven wrong. If someone is willing to experiment and to find the solution to solve the compatibility problem, please reopen the issue. > > Matz. Could you please point us to an existing discussion or maybe show a few examples? ---------------------------------------- Feature #16939: Alias _1 as _ for block numbered params https://bugs.ruby-lang.org/issues/16939#change-86094 * Author: x3qt (Yury Polyakov) * Status: Closed * Priority: Normal ---------------------------------------- I propose to alias `_1` as `_` for block numbered params, so the following statements should be equal ��� ``` ruby [1,2,3].map { _1 ** 2 } [1,2,3].map { _ ** 2 } ``` There is an [anonymous function argument literal](https://clojure.org/reference/reader#_dispatch) in Clojure and it feels natural all the way, hope we can have the one too. -- https://bugs.ruby-lang.org/ Unsubscribe: