From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7342 invoked by alias); 26 Apr 2018 19:51:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7242 invoked by uid 89); 26 Apr 2018 19:51:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1342, Rust, rust, ranges X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Apr 2018 19:51:26 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id C6C4E6605A0 for ; Thu, 26 Apr 2018 14:51:24 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id BmvMfYKFxA3CSBmvMfdqh6; Thu, 26 Apr 2018 14:51:24 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:58724 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fBmvM-0028qH-Hr; Thu, 26 Apr 2018 14:51:24 -0500 From: Tom Tromey To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Add inclusive range support for Rust References: <20180329201609.13699-1-tom@tromey.com> <20180425162741.pniyyy23uowaxcix@adacore.com> Date: Thu, 26 Apr 2018 19:51:00 -0000 In-Reply-To: <20180425162741.pniyyy23uowaxcix@adacore.com> (Joel Brobecker's message of "Wed, 25 Apr 2018 09:27:41 -0700") Message-ID: <87h8nx7nlw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fBmvM-0028qH-Hr X-Source-Sender: 97-122-176-117.hlrn.qwest.net (pokyo) [97.122.176.117]:58724 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-04/txt/msg00538.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: >> BOTH_BOUND_DEFAULT, /* "(:)" */ >> LOW_BOUND_DEFAULT, /* "(:high)" */ >> HIGH_BOUND_DEFAULT, /* "(low:)" */ >> - NONE_BOUND_DEFAULT /* "(low:high)" */ >> + NONE_BOUND_DEFAULT, /* "(low:high)" */ >> + NONE_BOUND_DEFAULT_INCLUSIVE, /* Rust "low..=high" */ >> + LOW_BOUND_DEFAULT_INCLUSIVE, /* Rust "..=high" */ >> }; Joel> Where the bounds exclusive before? The comments and the samples Joel> of code I have been finding seem to indicate that the bounds Joel> were already considered inclusive. But I can see how this is Joel> not all that clear. Yes, I think you are right -- they were inclusive for Fortran. >From value_f90_subarray: return value_slice (array, low_bound, high_bound - low_bound + 1); What was weird then was that Rust treated them as exclusive, because at the time Rust only had exclusive ranges. I can change this and rename the new constants *_EXCLUSIVE. Joel> Perhaps one way to clarify that is to use language-agnostic mathematical Joel> notations for the ranges? Eg, using square brackets such as "[1:3[" or Joel> perhaps "[1:3)" as I have sometimes seen? I think it's simple to just write out some text explaining the meanings. Then we won't need to worry whether someone knows the notation. Tom