https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112019-04-01T03:37:59ZRuby Issue Tracking SystemRuby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=773932019-04-01T03:37:59Zsawa (Tsuyoshi Sawada)
<ul></ul><p>I do not think that 1-based is a problem at all. As some have already noticed in a different thread, regex captures are 1-based, and no one has complained about it. I think it is more natural to have it 1-based.</p> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=774082019-04-01T05:32:59Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-6 priority-4 priority-default closed" href="/issues/12240">Feature #12240</a>: circle number arguments</i> added</li></ul> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=774152019-04-01T07:59:32Zshevegen (Robert A. Heiler)shevegen@gmail.com
<ul></ul><p>Check the date sawa. :)</p>
<p>The thing is, though ... if we ignore the date (and I guess nobu is having fun<br>
since it may seem less obvious if mame creates the issue ;) ) ... actually I did<br>
want to propose adding .second .third and so forth, since we have .first and .last<br>
already. Not to block-parameters, but in general available for where we already<br>
use .first and last. But I was not completely sure about whether it is that<br>
needed/necessary, and possibly it was already suggested before.</p>
<p>The reason why I did want to suggest it was mostly for code like this:</p>
<pre><code>some_array = [] # it gets filled up with data
person_name = some_array.first
person_height = some_array[1]
person_age = some_array.last
</code></pre>
<p>Now for the moment let's ignore that a Hash would be better for this,<br>
it is just meant for illustration purpose. My argument would be that<br>
[1] looks strange when I already use .first and .last, so I wanted<br>
to use .second instead.</p>
<p>However had ... my use case is not that good nonetheless. It's just<br>
mostly a visual thing ... when I use [0], [1], [2] then this looks<br>
fine; and when I use .first and .last this looks fine too. It only<br>
looked strange when I would mix both.</p>
<p>Another problem was that, for example, how often would people use<br>
something like .fifth? Or .sixth? Probably not that often. So I<br>
sort of abandoned that ideal for a proposal.</p>
<p>I did, however had, also want to suggest another one on this first<br>
april, aka to suggest a compiled variant of ruby. And while 95% of<br>
this would have been meant as a joke, 5% would have been serious.</p>
<p>I twould not have to be ruby exactly, but just a compiled language,<br>
a bit like the ruby-crystal situation (but matz would design it;<br>
but no worries, even in my joke suggestion, I would not suggest<br>
that matz would IMPLEMENT it - it was only meant for the design<br>
stage). And probably a full alternative to C too. One reason here<br>
was that many casual or less formal users do not know C yet the<br>
really cool things all seem to happen in/through C.</p> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=774162019-04-01T08:32:59Zsawa (Tsuyoshi Sawada)
<ul></ul><p>shevegen (Robert A. Heiler) wrote:</p>
<blockquote>
<p>Check the date sawa. :)</p>
</blockquote>
<p>I see. Honestly, I have never felt this kind of stuff to be funny.</p> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=776592019-04-17T08:42:18Zioquatix (Samuel Williams)samuel@oriontransfer.net
<ul></ul><p>You make localisation a problem of the language syntax. For example, in the original code: <code>2rd</code> is actually not correct, it should be <code>2nd</code>. Other localisations are even more complicated, e.g. Russian.</p> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=776642019-04-18T13:39:59ZEregon (Benoit Daloze)
<ul><li><strong>Assignee</strong> set to <i>10790</i></li></ul> Ruby master - Feature #15741: Ordinal parametershttps://redmine.ruby-lang.org/issues/15741?journal_id=776712019-04-19T13:11:48Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>I forgot to close this ticket. Thanks.</p>