https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112014-10-05T22:46:10ZRuby Issue Tracking SystemRuby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492082014-10-05T22:46:10Zgogotanaka (Kazuki Tanaka)mail@tanakakazuki.com
<ul><li><strong>File</strong> <a href="/attachments/4741">convert_tabs_to_spaces.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4741/convert_tabs_to_spaces.patch">convert_tabs_to_spaces.patch</a> added</li></ul> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492102014-10-06T01:33:13Zsawa (Tsuyoshi Sawada)
<ul></ul><p>When there is more than one parameter passed to a block, your proposal will create a problem.</p>
<p>When the number of parameters passed to a block is more than the number of block variables in <code>||</code>, then destructive assignment should apply, but your proposal will make this not happen. It will be incompatible with many existing code.</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492172014-10-06T06:26:40Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Why expanding tabs?</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492182014-10-06T06:56:59Zgogotanaka (Kazuki Tanaka)mail@tanakakazuki.com
<ul></ul><p>@Tsuyoshi Sawada san</p>
<p>Thank you for your comment. I got your point.</p>
<p>As you said (and I mentioned also) it has much pain, so I can't implement right now.</p>
<p>How do you think about the case giving a argument?</p>
<p>I mean like that.</p>
<pre><code>['foo', 'bar', 'foobar'].select { _.include?('foo') }
['foo', 'bar', 'foobar'].each { eval(_) }
</code></pre> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492202014-10-06T07:13:16Zgogotanaka (Kazuki Tanaka)mail@tanakakazuki.com
<ul></ul><p>@Nobuyoshi Nakada san</p>
<p>Thank you for your comment.</p>
<p>Starting to implement this issue, I find spaces and tabs being mixed.</p>
<p>And I suppose this might make us confusion and there are no reason spaces and tabs be mixed, but I am afraid a conflict.</p>
<p>This is why I upload this patch at first.</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492222014-10-06T09:05:14Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Welcome to the underground holy war. ;)<br>
You may know that ruby-style.el has <code>(indent-tabs-mode . t)</code>.</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=492312014-10-06T15:57:17Zgogotanaka (Kazuki Tanaka)mail@tanakakazuki.com
<ul></ul><p>@Nobuyoshi Nakada san</p>
<p>It was an honor to encounter such a underground holy war.</p>
<p>Sure. I'll follow what you said.</p>
<p>Thank you.</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=498182014-11-05T21:29:29Zgogotanaka (Kazuki Tanaka)mail@tanakakazuki.com
<ul></ul><p>oops... I found totally <a href="https://github.com/rails/rails/blob/cd2d3664e3b434d15b6c19e652befb386187642f/activesupport/lib/active_support/core_ext/object/try.rb#L71" class="external">incompatible code in Rails</a> project.<br>
I gave up this approach. Nonetheless, I still wanna introduce concept omitting obvious variable. (Like Scala's lambda calculus)<br>
<a href="https://bugs.ruby-lang.org/issues/10394" class="external">#10394</a> does make sense so far?</p> Ruby master - Feature #10318: [PATCH 0/n] Let underscore be positionally matched arg to omit binding obvious variable.https://redmine.ruby-lang.org/issues/10318?journal_id=891092020-12-10T08:53:41Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>3.0</i></del>)</li></ul>