From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.bugs Subject: bug#15859: 24.3.50; Calc - dimensionless units again Date: Mon, 17 Apr 2023 10:20:15 -0500 Message-ID: <87jzya8rio.fsf@gnu.org> References: <21120.6201.687671.227593@gargle.gargle.HOWL> <87a5zacxb3.fsf@web.de> <87r0sj8690.fsf@gnu.org> <87fs8y7ggf.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 15859@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 17 17:21:30 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poQfa-00015I-0y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Apr 2023 17:21:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poQfH-0004XW-Ix; Mon, 17 Apr 2023 11:21:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poQf8-0004Ts-R4 for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 11:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poQf8-0002TV-Dq for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1poQf7-00011A-Sp for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2023 11:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Roland Winkler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Apr 2023 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15859 X-GNU-PR-Package: emacs Original-Received: via spool by 15859-submit@debbugs.gnu.org id=B15859.16817448253849 (code B ref 15859); Mon, 17 Apr 2023 15:21:01 +0000 Original-Received: (at 15859) by debbugs.gnu.org; 17 Apr 2023 15:20:25 +0000 Original-Received: from localhost ([127.0.0.1]:55794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poQeW-0000zz-Pd for submit@debbugs.gnu.org; Mon, 17 Apr 2023 11:20:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poQeV-0000zm-2M for 15859@debbugs.gnu.org; Mon, 17 Apr 2023 11:20:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poQeP-0002Ku-HN; Mon, 17 Apr 2023 11:20:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=UHCkvIRilr7+rbBCrDUueJFf6F3P9LQYQLJ7XHJ89MY=; b=Ylb3qBLqqBCvSKgRmJKg qkMdMfK2tsi26Hkd/sJpCZqgZA6hjsWjDAAk5zflzbsaPsAKtC1jEbBC/ODs1TUP5wH+0YiEZmipJ DHv33tCXYM4l96dLE4pH1l1hX+hgcpj1J0ohkqAvh5cW3/wXkAJrg56CqrpmSdbqN1OtWwgqd/2ge PCSvDndpvLZlmw6LnCQAukpYt0VwL3rh/4LGAD4MRbKx9cuJrKmJ1KTLs3jrDR5jAttBOEEpbjeBy ZIpLwqB7VqYskn+v/ppHZQYArEcL4GPeNDltGKiIV/OLMCK2RNKbN9lqc23ul7WMoMPJxftTiLXLY hACjD89vtVHKWg==; Original-Received: from [130.202.136.149] (helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poQeP-00066L-8s; Mon, 17 Apr 2023 11:20:17 -0400 In-Reply-To: <87fs8y7ggf.fsf@web.de> (Michael Heerdegen's message of "Mon, 17 Apr 2023 16:04:32 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260185 Archived-At: On Mon, Apr 17 2023, Michael Heerdegen wrote: > I would like to know what the changes since then tried to accomplish/fix > and what we loose when we revert to the old definition. That's a very good question. In my experience, there was never a problem with the old code where it yielded incorrect results nor have I encountered a situation where these changes improved anything (in whatever vague sense). Most importantly, at some point I checked the bug-gnu-emacs archive, when I could not find a bug report that could have triggered the changes in the code, nor there was any explanation in a ChangeLog or commit message that would have explained why these changes were done. So from all I can tell, these changes were introduced for no clear reason, but they only broke things. >> (defun calc-convert-units (&optional old-units new-units) >> (interactive) >> [...] > > Reverting only that definition does not fix your > "convert 7m / (c s) to in / (c hr)" example. Good point. I must have come up with this example at a point in time when I couldn't check what the old code would do. In any case, running this example with the old code yields a behavior that is mathematically perfectly correct, whereas the new code asks a meaningless question about a unit for the expression "7m / (c s)". Strange enough, the old code even handles fine the case that "7m / (c s)" is converted to a user-defined dimensionless unit such as Pi. Again, the bottom line is that the old code works correct, whereas the new code cannot handle expressions where the units can be simplified to a dimensionless number. Therefore, I believe reverting the changes to calc-convert-units is the best thing to do. Then, any future changes should document the use cases they intend to fix or address.