From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DDC0C1F453 for ; Tue, 30 Apr 2019 16:02:41 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 574C9120B1A; Wed, 1 May 2019 01:02:35 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id F33F4120A31 for ; Wed, 1 May 2019 01:02:33 +0900 (JST) Received: by filter0159p3mdw1.sendgrid.net with SMTP id filter0159p3mdw1-11212-5CC87184-1 2019-04-30 16:02:12.01368869 +0000 UTC m=+416507.556137103 Received: from herokuapp.com (unknown [3.86.82.84]) by ismtpd0048p1mdw1.sendgrid.net (SG) with ESMTP id w0evQakMQ-GBRLSNLZ6anA for ; Tue, 30 Apr 2019 16:02:11.777 +0000 (UTC) Date: Tue, 30 Apr 2019 16:02:30 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67982 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15745 X-Redmine-Issue-Author: koic X-Redmine-Sender: mame X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?EJh2gqwnyqXtd++xo=2FinyA1V0bXouTB4FkWnzNiKb4=2FtJ2ja6ATmvDznqghfys?= =?us-ascii?Q?W=2F4EdfSfYgAt60K9=2Flu8dmbm=2FGCCLxgQp4HZ5Kr?= =?us-ascii?Q?WU0i8r3yVWyMiUxGQsuytpFArz=2FIVTNOezNHyg9?= =?us-ascii?Q?UFvFyEhpKBPlUOwOzZ8iOQYmYEzr0jmZojyLICs?= =?us-ascii?Q?=2FSfyqdxr23wyAiIqll+PY8ANpo8FeX=2F69Kw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92499 Subject: [ruby-core:92499] [Ruby trunk Bug#15745] There is no symmetry in the beginless range and the endless range using `Range#inspect` X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15745 has been updated by mame (Yusuke Endoh). I think we digress. I had no intention to discuss a beginless range itself, but maybe it started digressing. My apologies. Let's focus on the original topic in this ticket. Do you think which is the best? (0) Keep the current behavior: `p (1..) #=> (1..)`, `p (..1) #=> (nil..1)`, and `p (nil..nil) #=> (nil..)`. (1) Make all cases explicit: `p (1..) #=> (1..nil)`, `p (..1) #=> (nil..1)`, and `p (nil..nil) #=> (nil..nil)`. (2) Omit all `nil`s except `(nil..nil)`: `p (1..) #=> (1..)`, `p (..1) #=> (..1)`, and `p (nil..nil) #=> (nil..nil)`. I have no strong opinion. (Honestly, I'm not so interested in the result of `inspect` in this case.) But if I have to choose, my current opinion is (0). * (0) is somewhat reasonable for me. * (1) looks a bit verbose to me (and brings tiny incompatibility). * I don't like (2) because of the special handling. Let me know your opinions. I'll bring them to the next dev meeting and ask matz decide. ---------------------------------------- Bug #15745: There is no symmetry in the beginless range and the endless range using `Range#inspect` https://bugs.ruby-lang.org/issues/15745#change-77860 * Author: koic (Koichi ITO) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0dev (2019-04-03 trunk 67423) [x86_64-darwin17] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- The following commit introduces beginless range. https://github.com/ruby/ruby/commit/95f7992b89efd35de6b28ac095c4d3477019c583 ``` % ruby -v ruby 2.7.0dev (2019-04-03 trunk 67423) [x86_64-darwin17] ``` There is no symmetry with endless range when using `Range#inspect` method. ``` (1..).inspect # => "1.." (..5).inspect # => "nil..5" ``` How about unifying whether it represents `nil`? -- https://bugs.ruby-lang.org/