From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94757 invoked by alias); 25 Apr 2018 16:27:46 -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 94748 invoked by uid 89); 25 Apr 2018 16:27:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Apr 2018 16:27:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C9EC211750B; Wed, 25 Apr 2018 12:27:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oWebHu4yQAPt; Wed, 25 Apr 2018 12:27:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9A7B011750A; Wed, 25 Apr 2018 12:27:43 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id EDD3783055; Wed, 25 Apr 2018 09:27:41 -0700 (PDT) Date: Wed, 25 Apr 2018 16:27:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Add inclusive range support for Rust Message-ID: <20180425162741.pniyyy23uowaxcix@adacore.com> References: <20180329201609.13699-1-tom@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180329201609.13699-1-tom@tromey.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-04/txt/msg00519.txt.bz2 Hi Tom, > /* In an OP_RANGE expression, either bound could be empty, indicating > that its value is by default that of the corresponding bound of the > - array or string. So we have four sorts of subrange. This > - enumeration type is to identify this. */ > - > + array or string. Also, the upper end of the range can be exclusive > + or inclusive. So we have six sorts of subrange. This enumeration > + type is to identify this. */ > + > enum range_type > { > 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" */ > }; Where the bounds exclusive before? The comments and the samples of code I have been finding seem to indicate that the bounds were already considered inclusive. But I can see how this is not all that clear. Perhaps one way to clarify that is to use language-agnostic mathematical notations for the ranges? Eg, using square brackets such as "[1:3[" or perhaps "[1:3)" as I have sometimes seen? I'll continue with the rest of the patch in the meantime... -- Joel