From: eregontp@... Date: 2019-04-18T13:40:01+00:00 Subject: [ruby-core:92322] [Ruby trunk Feature#15741] Ordinal parameters 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/ Unsubscribe: