From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger Newsgroups: gmane.emacs.bugs Subject: bug#10554: 24.0.92; No units specified (dimensionless quantities in Emacs Calc) Date: Fri, 20 Jan 2012 18:00:39 -0600 Message-ID: <87r4yt9b6g.fsf@gmail.com> References: <8762g8i7s6.fsf@niu.edu> <87bopz5pt8.fsf@gmail.com> <20248.39483.716850.185512@gargle.gargle.HOWL> <87d3afdlfz.fsf@gmail.com> <20249.10002.733142.491623@gargle.gargle.HOWL> <8739bajp5k.fsf@gmail.com> <20249.43656.150957.30947@gargle.gargle.HOWL> <8739bab36p.fsf@gmail.com> <20249.52946.931367.162775@gargle.gargle.HOWL> <87lip29jsn.fsf@gmail.com> <20249.58980.778477.37221@gargle.gargle.HOWL> Reply-To: jay.p.belanger@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1327104117 22155 80.91.229.12 (21 Jan 2012 00:01:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Jan 2012 00:01:57 +0000 (UTC) Cc: 10554@debbugs.gnu.org To: "Roland Winkler" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 21 01:01:53 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RoOP2-00067f-RX for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jan 2012 01:01:53 +0100 Original-Received: from localhost ([::1]:54984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoOP1-0000x0-FU for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jan 2012 19:01:51 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoOOy-0000wu-Hv for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2012 19:01:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoOOs-0000aF-TB for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2012 19:01:48 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoOOs-0000Zw-RX for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2012 19:01:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RoOQ9-0000tH-VC for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2012 19:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jay Belanger Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2012 00:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10554-submit@debbugs.gnu.org id=B10554.13271041273337 (code B ref 10554); Sat, 21 Jan 2012 00:03:01 +0000 Original-Received: (at 10554) by debbugs.gnu.org; 21 Jan 2012 00:02:07 +0000 Original-Received: from localhost ([127.0.0.1]:37038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoOPG-0000rl-Cv for submit@debbugs.gnu.org; Fri, 20 Jan 2012 19:02:07 -0500 Original-Received: from mail-gy0-f172.google.com ([209.85.160.172]:63651) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RoOPD-0000rZ-4L for 10554@debbugs.gnu.org; Fri, 20 Jan 2012 19:02:04 -0500 Original-Received: by ghbg16 with SMTP id g16so102144ghb.3 for <10554@debbugs.gnu.org>; Fri, 20 Jan 2012 16:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:reply-to:cc:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=xVnSKHQhgv6jhzsFrpNqZ7rcrnmYD52x4m7Ugcm1NYs=; b=CqZ4KjK26bMVwjxas2KduTcBZOPldA491xpXQLZHpWnMRCEwMy2qMkw9Be3cm0QZsy +B7nqDMIQRkAshHEPFskfbBEfJN4LZQ+ZdCIg5Y2T8a1wimg+Zm0b9YeSpEniyL7jJ3b I8rVtC4QM3unruvHGQLODreLOQtlu5pBHirqY= Original-Received: by 10.236.200.164 with SMTP id z24mr49719332yhn.52.1327104042899; Fri, 20 Jan 2012 16:00:42 -0800 (PST) Original-Received: from belanger-home (184-155-95-203.cpe.cableone.net. [184.155.95.203]) by mx.google.com with ESMTPS id 9sm12515458ans.15.2012.01.20.16.00.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 16:00:42 -0800 (PST) In-Reply-To: <20249.58980.778477.37221@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 20 Jan 2012 16:10:44 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55880 Archived-At: > Great, thanks! Do you also see a possiblity to implement the other > scheme I suggested (attached below once more)? That would be > wonderful! ... > - if the old expression has units that cancel completely (e.g., > as in my orginal bug report) or it has a unit like "alpha", > one can specify "1" as the new unit and the unit conversion > returns a plain number. If the "error if the units don't match" option is chosen, I would think this would naturally be the default. If partial conversions are allowed, I don't think "1" as a unit should trigger an error, but I think it should still be a no-op. > - similarly: if the old expression is just a number (i.e., unit > "1"), this can be converted to other dimensionless units such > as "alpha" without being asked for the old unit. This I'm not too sure about. The current behavior allows the user to convert units without having the units explicit in the expression, so for example 45 u c mi/hr RET km/hr would convert 45 mi/hr to km/hr. This, I believe, was put in as a feature, not a bug. > (Yes, I am irritated if calc-convert-units asks me about the > old unit if there is just a plain number on the stack. So > backward compatibility would probably require a variable such > as calc-treat-numbers-as-dimensional, bound to nil by > default.) An option might be reasonable, with the current behavior the default. But this would only be useful when changing a number to a dimensionless quantity, like alpha, it seems. > (2) The old expression is not dimensionless such as "7 m", the new > unit is "1". Here I suggest that partial conversion means to > return the old expression without any unit conversion. Basically the current behavior (without the error). But with the "need matching units", this should give an error. > (this would be quite consistent with how Calc already treats the > case that the old expression is something like "7 m", and the > new unit is "alpha".) > > (3) The old expression is a dimensionless number, the requested new > unit is something like "m": > > Here I suggest to just return the old expression unmodified Unless the "need matching units" option is chosen, in which case this would give an error.