* [ruby-core:92067] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
@ 2019-04-01 0:01 ` mame
2019-04-01 3:38 ` [ruby-core:92069] " sawadatsuyoshi
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: mame @ 2019-04-01 0:01 UTC (permalink / raw
To: ruby-core
Issue #15741 has been reported by mame (Yusuke Endoh).
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92069] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
2019-04-01 0:01 ` [ruby-core:92067] [Ruby trunk Feature#15741] Ordinal parameters mame
@ 2019-04-01 3:38 ` sawadatsuyoshi
2019-04-01 7:59 ` [ruby-core:92084] " shevegen
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: sawadatsuyoshi @ 2019-04-01 3:38 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by sawa (Tsuyoshi Sawada).
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.
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77393
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92084] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
2019-04-01 0:01 ` [ruby-core:92067] [Ruby trunk Feature#15741] Ordinal parameters mame
2019-04-01 3:38 ` [ruby-core:92069] " sawadatsuyoshi
@ 2019-04-01 7:59 ` shevegen
2019-04-01 8:33 ` [ruby-core:92085] " sawadatsuyoshi
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: shevegen @ 2019-04-01 7:59 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by shevegen (Robert A. Heiler).
Check the date sawa. :)
The thing is, though ... if we ignore the date (and I guess nobu is having fun
since it may seem less obvious if mame creates the issue ;) ) ... actually I did
want to propose adding .second .third and so forth, since we have .first and .last
already.
The reason why was mostly for code like this:
some_array = [] # it gets filled with stuff
person_name = some_array.first
person_height = some_array[1]
person_age = some_array.last
Now for the moment let's ignore that a Hash would be better for this,
it is just meant for illustration purpose. My argument would be that
[1] looks strange when I already use .first and .last, so I wanted
to use .second instead.
However had ... my use case is not that good nonetheless. It's just
mostly a visual thing ... when I use [0], [1], [2] then this looks
fine; and when I use .first and .last this looks fine too. It only
looked strange when I would mix both.
Another problem was that, for example, how often would people use
something like .fifth? Or .sixth? Probably not that often. So I
sort of abandoned that ideal for a proposal.
I did, however had, also want to suggest another one on this first
april, aka to suggest a compiled variant of ruby. And while 95% of
this would have been meant as a joke, 5% would have been serious.
I twould not have to be ruby exactly, but just a compiled language,
a bit like the ruby-crystal situation (but matz would design it;
but no worries, even in my joke suggestion, I would not suggest
that matz would IMPLEMENT it - it was only meant for the design
stage). And probably a full alternative to C too. One reason here
was that many casual or less formal users do not know C yet the
really cool things all seem to happen in/through C.
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77415
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92085] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
` (2 preceding siblings ...)
2019-04-01 7:59 ` [ruby-core:92084] " shevegen
@ 2019-04-01 8:33 ` sawadatsuyoshi
2019-04-17 8:42 ` [ruby-core:92315] " samuel
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: sawadatsuyoshi @ 2019-04-01 8:33 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by sawa (Tsuyoshi Sawada).
shevegen (Robert A. Heiler) wrote:
> Check the date sawa. :)
I see. Honestly, I have never felt this kind of stuff to be funny.
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77416
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92315] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
` (3 preceding siblings ...)
2019-04-01 8:33 ` [ruby-core:92085] " sawadatsuyoshi
@ 2019-04-17 8:42 ` samuel
2019-04-18 13:40 ` [ruby-core:92322] " eregontp
2019-04-19 13:11 ` [ruby-core:92329] " mame
6 siblings, 0 replies; 7+ messages in thread
From: samuel @ 2019-04-17 8:42 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by ioquatix (Samuel Williams).
You make localisation a problem of the language syntax. For example, in the original code: `2rd` is actually not correct, it should be `2nd`. Other localisations are even more complicated, e.g. Russian.
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77659
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92322] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
` (4 preceding siblings ...)
2019-04-17 8:42 ` [ruby-core:92315] " samuel
@ 2019-04-18 13:40 ` eregontp
2019-04-19 13:11 ` [ruby-core:92329] " mame
6 siblings, 0 replies; 7+ messages in thread
From: eregontp @ 2019-04-18 13:40 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by Eregon (Benoit Daloze).
Assignee set to joke
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77664
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: joke
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:92329] [Ruby trunk Feature#15741] Ordinal parameters
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
` (5 preceding siblings ...)
2019-04-18 13:40 ` [ruby-core:92322] " eregontp
@ 2019-04-19 13:11 ` mame
6 siblings, 0 replies; 7+ messages in thread
From: mame @ 2019-04-19 13:11 UTC (permalink / raw
To: ruby-core
Issue #15741 has been updated by mame (Yusuke Endoh).
Status changed from Open to Rejected
I forgot to close this ticket. Thanks.
----------------------------------------
Feature #15741: Ordinal parameters
https://bugs.ruby-lang.org/issues/15741#change-77671
* Author: mame (Yusuke Endoh)
* Status: Rejected
* Priority: Normal
* Assignee: joke
* Target version: Next Major
----------------------------------------
Numbered parameters have been introduced into trunk, and are still being hotly debated in #15723.
One of the problems of the feature is, too short, too symbolic, and then too cryptic. It resembles Perl.
I counterpropose "ordinal parameters":
```
$ ./miniruby -e '
[ [1, 1, 1], [2, 2, 2], [3, 3, 3] ].each { p 0th * 1st * 2rd }
'
1
8
27
```
Ordinal parameters are much better than numbered parameters in two points:
* It is English. No symbol is used. It looks nicer, doesn't it?
* Some people are complaining that `@1` is one-based. Instead, my proposal is zero-based: it starts with `0th`.
In other words, it no longer resembles the notorious `$1` at all.
You may wonder if it is too friendly for English speakers. Don't worry, it is carefully designed:
* It is tolerant of small errors. In fact, "2rd" (not "2nd") is allowed. This is because I often typo.
* Even "1th", "2th", and "3th" are allowed. Non-English-native programmers don't have to learn the difference among "st", "nd", "rd", and "th".
A patch is attached.
---Files--------------------------------
ordinal-parameters.patch (1.62 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-19 13:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <redmine.issue-15741.20190401000135@ruby-lang.org>
2019-04-01 0:01 ` [ruby-core:92067] [Ruby trunk Feature#15741] Ordinal parameters mame
2019-04-01 3:38 ` [ruby-core:92069] " sawadatsuyoshi
2019-04-01 7:59 ` [ruby-core:92084] " shevegen
2019-04-01 8:33 ` [ruby-core:92085] " sawadatsuyoshi
2019-04-17 8:42 ` [ruby-core:92315] " samuel
2019-04-18 13:40 ` [ruby-core:92322] " eregontp
2019-04-19 13:11 ` [ruby-core:92329] " mame
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).