From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AKHPG3Sgrl/5cQAAWB0awg (envelope-from ) for ; Fri, 13 Nov 2020 10:04:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 6FFB61F08B; Fri, 13 Nov 2020 10:04:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 205611E552 for ; Fri, 13 Nov 2020 10:04:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A0B6F3857021; Fri, 13 Nov 2020 15:04:19 +0000 (GMT) Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 4E2953858004 for ; Fri, 13 Nov 2020 15:04:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E2953858004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B07AF56253; Fri, 13 Nov 2020 10:04:16 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com 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 CQ9VQmR8fs5O; Fri, 13 Nov 2020 10:04:16 -0500 (EST) Received: from murgatroyd (97-122-89-243.hlrn.qwest.net [97.122.89.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 4443B56251; Fri, 13 Nov 2020 10:04:16 -0500 (EST) From: Tom Tromey To: Joel Brobecker Subject: Re: [PATCH 3/9] gmp-utils: New API to simply use of GMP's integer/rational/float objects References: <1604817017-25807-1-git-send-email-brobecker@adacore.com> <1604817017-25807-4-git-send-email-brobecker@adacore.com> <2966f3cf-955c-1849-e7ab-f01843cb7a33@simark.ca> <20201113081230.GA281286@adacore.com> X-Attribution: Tom Date: Fri, 13 Nov 2020 08:04:15 -0700 In-Reply-To: <20201113081230.GA281286@adacore.com> (Joel Brobecker's message of "Fri, 13 Nov 2020 12:12:30 +0400") Message-ID: <87y2j59u34.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Marchi , Tom Tromey , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >>>>> "Joel" == Joel Brobecker writes: >> There would need to be methods for arithmetic operations that we use >> (e.g. mpz_add), but we don't have to add methods for all existing >> functions in gmp, just the ones we use. And I presume we don't use that >> many. Joel> I'm not sure about that. The main purpose of these classes is to automate Joel> the lifetime of the data allocated when creating the underlying GMP objects. Joel> Beyond that, there are a few help routines that are connected as methods Joel> because it makes sense to do so now that we have the classes, but could Joel> have otherwise been just regular functions. I tend to think we should just leave it for now. My main reason is that the patches already exist & are tested in this form; and there are follow-up patches to post as well. And, it's taken quite a long while to find the necessary time to prep these for submission. Also perhaps instead of updating these we should reconsider using the c++ classes that come with gmp. See gmpxx.h or (info "(gmp) C++ Class Interface") (I'm don't recall why these weren't used, maybe it's the caveat in the manual. However I think we can probably deal with that ok.) Anyway, I'm happy to do either of these as follow-ups after landing. Unlike prepping the patches, this kind of work can readily be done in spare moments. Let me know if this plan is alright with you. >> Is this meant to be "operator="? Joel> Nice catch! I think so, and I'll fix if Tom confirms as well. Yeah, oops. Tom