From: rafasoaresms@... Date: 2021-04-27T18:30:40+00:00 Subject: [ruby-core:103623] [Ruby master Feature#17830] Add Integer#previous and Integer#prev Issue #17830 has been updated by rafasoares (Rafael Soares). sawa (Tsuyoshi Sawada) wrote in #note-6: > rafasoares (Rafael Soares) wrote in #note-5: > > He [matz] has often said that he is ���trying to make Ruby *natural, not simple*��� > > ... > > From https://www.ruby-lang.org and https://www.ruby-lang.org/en/about/ > > Not the main issue, but I need to point this out. Assuming that you are referring to this passage from the page you linked: > > >Ruby is simple in appearance, but is very complex inside, just like our human body. No, that's another quote. I'm referring to the one in the paragraph above. Complete excerpt here: > He has often said that he is ���trying to make Ruby natural, not simple,��� in a way that mirrors life. > > Building on this, he adds: > > > Ruby is simple in appearance, but is very complex inside, just like our human body[1]. Note how it says "building on this, he adds" and then there's the quote you referenced. So, to my understanding, the two sentences complement each other - but not exactly the same. To me, the charm of Ruby is precisely how natural it is to read and write. I'm only trying to improve this a bit. :) > I think you completely misunderstood what is written. You are claiming almost the opposite of what Matz said. He said that Ruby is simple (for users). And most likely that is intentional. However, in order to achieve that, he had to (perhaps unwillingly) make its implementation complex. How so? My goal here is precisely to make it simpler for users, even if it's a tiny bit. > Also, the other page you linked says: > > > A dynamic, open source programming language with a focus on simplicity and productivity. Yes. I omitted the "dynamic, open source programming language" part, as I didn't think it was relevant to the discussion. ---------------------------------------- Feature #17830: Add Integer#previous and Integer#prev https://bugs.ruby-lang.org/issues/17830#change-91720 * Author: rafasoares (Rafael Soares) * Status: Open * Priority: Normal ---------------------------------------- I think `Integer#pred` is great as the inverse of `#succ`, but it reads a bit weird as the inverse of `#next`, which might be preferable for those going for a more "reads like English" approach. On that note, `#previous` reads better, but it's also twice as long as `#pred` (or even `#next`). Which is why I've also added the shorthand `#prev` Since Ruby strives for readability, I always thought it was weird that the team omitted this improvement. Also, I thought about writing a gem for this, but: 1. Do we really want to add another gem for such a simple change to every project? 2. Monkey-patching gems feel dirty. Finally, I want to mention that I tried looking for previous discussions on this topic, as it seems likely someone would've brought this up at some point, but was unsuccessful. Probably due to the massive amount of baggage in the core issue tracker and mailing lists, I could've missed something among the noise. I've created a fork on GitHub (https://github.com/rafasoares/ruby/commit/05119848b1f480db2e809f964528799030cc7ebb) in order to open a PR, but decided to open this ticket as well, after reading the contributing guide more carefully. -- https://bugs.ruby-lang.org/ Unsubscribe: