From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WOjOE6hWVmNd4gAAbAwnHQ (envelope-from ) for ; Mon, 24 Oct 2022 11:11:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yPEAE6hWVmPxjgAAG6o9tA (envelope-from ) for ; Mon, 24 Oct 2022 11:11:04 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EF9953F9A2 for ; Mon, 24 Oct 2022 11:11:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omsLE-0002sb-It; Mon, 24 Oct 2022 03:57:48 -0400 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 1omsKa-0002mn-II for emacs-orgmode@gnu.org; Mon, 24 Oct 2022 03:57:08 -0400 Received: from mail-eopbgr20138.outbound.protection.outlook.com ([40.107.2.138] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omsKW-00014I-My for emacs-orgmode@gnu.org; Mon, 24 Oct 2022 03:57:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XKN+1XHlRscqS4us6QQfDkA/60+wuzpO75xfsa9ZJp4zMtEShjpePn6fRk6ccGfUUjrlME4FG9Aj5b5Mj1za3EKGiuIrhQq59Xna2GzKKq4LAJ7TCcvXcsNfwbpT8f/dVp16iD2pwjch7JTFuVMHjQxh5FpWsajcDpLBsrUwvfoAJkkKQYydd8FyA3sh9seU2JaOAf+WcYMyw3uLS4DyO4wVEWbke6LAObN0FLDS5uyFM7pNQB1ncko+p1YYyj9mrNC5Va8Osn5II+t7znkF+mUfIH8QiMKh2OYjoYBBXDBUVJpOBXr7OPXfoy1TqYDUoJeW8p8nCMMDlIMLfKP73w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2I5S0wZXB22xbuktdSM6M1aezISFtUrp51oMdGVyu3I=; b=nwhVrgGvpYew03Q29ZIBE4isAttpXZQms0BBmPA/sWj7f9VCM+NauhH2AEY6AVqxnb/haBBNqXN5kIUJ+L5ZKNSDtVre8y3ZzW5CUrRuGXLd5Hbobjdt5toWTtJGUdccLCMOI7MNt6p9AdVss+kQ5kuAr5vZyc03eKXvqL3nC9f8bE9bi+P13I7C/GUoyKZgfZ+KohV13TYD1JrMoN0Aje0H+9dasMrXugHhaZ6y9su0842fxqjiiFRNhbde51Uy3VLUTTmOIqxgZrpP88CrFrioYRoohXymVn7WJ4zTV8/JoO/3MB1h+dv0SYHImrgfV52O3AFwQPpW1M90bqdIFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucl.ac.uk; dmarc=pass action=none header.from=ucl.ac.uk; dkim=pass header.d=ucl.ac.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucl.ac.uk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2I5S0wZXB22xbuktdSM6M1aezISFtUrp51oMdGVyu3I=; b=KJjgDLmdeZm549fQQGD3jpiK/deNyZFuc5AFm282D0q04qe2zeZtxGMQc6wiF/zdq2qJuCcC4F7XSpRO9aGMd71SvuN0vJwuyipUpHYByk2DLdN4lxjJOH7CEIqoLdYBMwaeZlxLFgzo/HIz/36G1GWvybdDw1JomsuhWHoGZTA= Received: from AS4PR01MB10249.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4fa::21) by DU0PR01MB9143.eurprd01.prod.exchangelabs.com (2603:10a6:10:35e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Mon, 24 Oct 2022 07:56:58 +0000 Received: from AS4PR01MB10249.eurprd01.prod.exchangelabs.com ([fe80::e7eb:8ee5:5ec1:2673]) by AS4PR01MB10249.eurprd01.prod.exchangelabs.com ([fe80::e7eb:8ee5:5ec1:2673%8]) with mapi id 15.20.5746.021; Mon, 24 Oct 2022 07:56:58 +0000 From: "Fraga, Eric" To: Ypo CC: Org-mode Subject: Re: LIterate programming with calc (help) Thread-Topic: LIterate programming with calc (help) Thread-Index: AQHY52N3sPluuAx4d0GRGDiIovWO8Q== Date: Mon, 24 Oct 2022 07:56:58 +0000 Message-ID: <87r0yxr6wm.fsf@ucl.ac.uk> References: In-Reply-To: (Ypo's message of "Sun, 23 Oct 2022 14:15:19 +0200") Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Gnus/5.13 (Gnus v5.13) x-url: http://www.ucl.ac.uk/~ucecesf/ mail-followup-to: Org Mode List x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS4PR01MB10249:EE_|DU0PR01MB9143:EE_ x-ms-office365-filtering-correlation-id: 0dd830ad-5313-4d21-c8b1-08dab5955387 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gz3Zso5GSQ/gftGuzjP2a2QZn85SIliCJVfHG/vpJgb40srADWP5eRNzE12b0mPh1Qgj3nQQQ5hWLETsyVBr+jNRJ9Qas7KRhZY9MhOLKQQTOzbMo4tWPyBbbMP7EbUB8ss0PTYCDWGVssOQZ6zBihP8auZ3Ab/7nrSmxPxlRwIiGP3uE9ldi5zNJeJ27Y55ywePp9YryIyTGM2Up67lpY12P7c08fbUkqSNYwia8KxoWD3IML1AxBL46JR65Zm0VUx6L+reEbbPcAooW18UVncrwCc6x2HuyKnxMXAEgBzr0UWvbWNxA321HWU4DF2/Go/qmAGC3jrGfVIm9o6Sl58aogug5cQazs9Alr32CO2GP/Qm+xMSQRLPPjkqu5NHGwh9fGwhYtbVT2gVcmfRdW3KEf55VzkhBD8K4DG8mob+MM1avtubhDFQaLMeGiDFkSyVEk9jSzotWRgAc1TBujKFibGALMUHOTEESbSt0YEyrOK+wkAa7q+ODtCN+iTKpOnSdKttUh9X5htLavOMKeuq0cbGCQNo0xpzNG1wGvu2vKsyDb7FHPrht2uVigAnY+AGAG6XUBmTEY+JnKwZf8De93XOpP5MZo/zLxw5CCS6uNzW1zbVR7q23IktbmY7UEQ42IHb9m04NJq2uXyaIipyB6a2aZZd5x4SXO5nMifkwtRVj2ZNeDrfEfu/0dRpsudlS1fRtUv/UMQ0FK5inxG+iTpi7a7KX/ldFtz7BhC9XTwC4a6J9GjMPvxq9Dg6YU8rPRAqu4C8a/ajW3esMg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS4PR01MB10249.eurprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(376002)(39860400002)(136003)(396003)(451199015)(6512007)(6506007)(2616005)(478600001)(76116006)(64756008)(91956017)(186003)(66946007)(66556008)(83380400001)(8676002)(41300700001)(8936002)(26005)(66446008)(66476007)(4326008)(5660300002)(2906002)(6916009)(71200400001)(6486002)(316002)(4744005)(786003)(122000001)(86362001)(36756003)(38070700005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?UDwKkm/KKKDcDamwskROfu2Q+hl4+K3Qs2D/tvy70Rn+qpeD17HwmczBbE?= =?iso-8859-1?Q?ocK7gHDkrLMKUS+1IHB5VY/snvF2luWsFRTINeMbvJrQIQKcaIOfLon5xO?= =?iso-8859-1?Q?rNPdBVd9TTN5JKIZJpTrG+0oHLvN0eVRTBQy1JbcHKkJZ2PHKnbvaNN15Q?= =?iso-8859-1?Q?oIyY4rzWZU0k8gljqk2VDMPOvIdu241MnD3vhNP8kvBNrLyo4dGDxxcYPP?= =?iso-8859-1?Q?asmoS7WWE5jb3FJHCbZHF59PZxZaQ5rptZKowx+SL7WALZ9vXKYhXinC8P?= =?iso-8859-1?Q?AB13bx5J3nKMtqI+f/LtSojMGtClg/K8hT5jy+rJNwXfi7CvmduZQq3ZZp?= =?iso-8859-1?Q?GNq/9wjvzIqWpg576S/SaOCHESoVKl+c34iRkbp0f6OFJaNwO8UVHsVApv?= =?iso-8859-1?Q?brsNKM41ibdDtIr+hwngn9ol/BN5JwZxv0eYb7NiCTT2n9hKwj0IFLtCyg?= =?iso-8859-1?Q?y4Zac2v8T3GRX+5lrElJoAd1BsiLz0nA54xIJYFu0pCyIpTDyeQMhE1KwL?= =?iso-8859-1?Q?DpkCETR/toxJOr/YjssJ+W5D+nK4W4eLEwF3jh8j10TE1YUqu6gqdRUdc3?= =?iso-8859-1?Q?FP5k3hWFmYYvgHFE0xdXsTaPXGQfW9at6TdC/yXwiwsWRty4FZpHnWYYc1?= =?iso-8859-1?Q?lGvxzoOw9qpbtpaDGYo2rEL07DSuuJqCWhrXcFzwewK4NK1499ca67wEQN?= =?iso-8859-1?Q?FopWy645vrdlsg8SoZ34sxcYKyhcNt4hWAAv4sDlKLRNXMGwIjY5/30r1/?= =?iso-8859-1?Q?vv3SLObuB2OyAWjWdCJPbUzYZPBRQ1QZustFf4qqu+k7q4rsgMeeeK1z0U?= =?iso-8859-1?Q?hP8Vo7DBTJvvWhkSe3eu580MRCwWnbQ79lbIDYdc7UyNNAMcppnJ7bejsH?= =?iso-8859-1?Q?Jy/KqOvTHlqE4W+JGb3bYFxp+gDTTwzWOjvEuMT0R4z4l0g75xOa7oU+Kw?= =?iso-8859-1?Q?86CRSxBqbX0CuactzQIMRmURw9XYQwIYthyklekDiaSI8YL13vkOkaf86I?= =?iso-8859-1?Q?7X0nZqD5Z2EaiJQmcg+nfkD3Q8Ed6kMdrSr+hTukDxWxsPfrfUzQx0Lm0S?= =?iso-8859-1?Q?jgfyxb2Nr3cucopH57FJcMR2oayabuRRs4HB62k6YN2MwzsdKfpF+O6fhJ?= =?iso-8859-1?Q?joRls/jhwjsoKyA+k5TOB4QLjF95qBexrPt25XBow6hqlInEUtm2M8laYI?= =?iso-8859-1?Q?z4ty17bDl01JbDxUwqKYaM+XP6PQSVouuvUeZ0M6dGnlsArGM06TzSkFrZ?= =?iso-8859-1?Q?OkmgS5YiJ7GOkHEoOjpJI6oMR8XulMPLS2n8D0golz1AqZi1XGdrMiuJap?= =?iso-8859-1?Q?qWklhIaTEuVr52cSpfANStZHGAJg322iiDFGmbLdvZAx9vatM5fSISgZ73?= =?iso-8859-1?Q?J4k3c0IOGUYI4cEjQIcUllvVW2Eg40ijJL7tZxJJA9JDZZv0X/HijwEdup?= =?iso-8859-1?Q?LyETL2XOvEgg+gxL+usJdAeJEHYkEGmPexTUqt5mYdf8Y/H/kJ9WmW66qq?= =?iso-8859-1?Q?TvrNdymMY5yCuJ+7WP2ApX1RazN2qA72lx2NDATI6SgUNXEm2j8SeDFXhm?= =?iso-8859-1?Q?goln+mL8wOKFJT9jLK0WgZyZJSQJ9TRPcq3bpTmUdtTwUj2+u1UwCDTEXq?= =?iso-8859-1?Q?BWgaYea22ckgdCzY2Ew+IBk7y+GEaGUlpi?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: ucl.ac.uk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS4PR01MB10249.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dd830ad-5313-4d21-c8b1-08dab5955387 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2022 07:56:58.2352 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1faf88fe-a998-4c5b-93c9-210a11d9a5c2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jUTb1KkUMWjESN1K+tKMxEMdGAMC2WA3fZGPUjbdXEei2r3ZTQ3KLF8jzwEmwqv4EeC6bI5J+ajRBQ4uQLzQEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR01MB9143 Received-SPF: pass client-ip=40.107.2.138; envelope-from=e.fraga@ucl.ac.uk; helo=EUR02-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666602664; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2I5S0wZXB22xbuktdSM6M1aezISFtUrp51oMdGVyu3I=; b=rrUQfSxbmL4OsIZJJe9RSLo1QUCQttoI/KPOireuB7cNITLEylwBkEfzT15ZH93JWC0U3k Wd7LiyPxJpz8V9wso83ucsyq5M3hIKB8SQsOGkkCKqBo+ufwFI+7sReedS/3DdHyVcJtRg DorTLLr0gJvJLv8tWdx7TzOrJlvh3VCaU9cgBFoN0Xi1qgepVdOOM1FYxCDrrurZkZZnFz gR2bynQffIznQ6cTFEJd03Kq1YPtsepptcsVE7SJ4OZPj6tcgLp3pCvPxFKEgMdSJZmDL9 dK/j+eTc4Xm2Ch9XyzpEhC62u+quEfuhKAVtByBBjsYkK8R6rNfEnF9Lc436hQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1666602664; a=rsa-sha256; cv=pass; b=m2GHH1/qQIsWFB9vFDkZ1D7MkaYRLNNX0n9trlQ+UJ8lZfaymUeLf90JToL97yhXUni0vq Kue/hZG8PcHhinZSFBxByogR4GGOnuUJTw4v8/VT9tIFfnvg2W66LPXih9aUyF99KwZsOi dNxcI712mfA1d/cm068DZLnWcHhRGwJx1Q2FMovvTQPHa8lFwwJya428XOGznBf2aWpBJx ZjUbSvLmCrL3h87bFlGMNsGSSFywmIZO7YsTp9jmKCDwWftTkbTrgsj4oIZyitVxsJqcUe nQBsg4RDbKM1UGqB8oGmQ09iLOUElMnsIYzW4bhL6nf3CzyEV5r1ihk8Z3Vmyw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=ucl.ac.uk header.s=selector1 header.b=KJjgDLmd; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=ucl.ac.uk; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ucl.ac.uk header.s=selector1 header.b=KJjgDLmd; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=ucl.ac.uk; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EF9953F9A2 X-Spam-Score: -8.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1Lqzm71n3L0N On Sunday, 23 Oct 2022 at 14:15, Ypo wrote: > Is it possible to express in a calc block some basic operations with > variables and non-predefined units? > Why A*c won't show an arithmetic result, but ~: A c ~? I've never managed to get calc blocks define variables. The equations you have typed in are "equations" in the mathematical sense, not assignment statements. > Is it possible to work with the "$" unit? $ means something specific in calc (cannot remember what). I use "USD" instead, for instance, and it works fine. The following single line calc block does do what you want: #+begin_src calc solve([a =3D 300 m, b =3D 300 m, Area =3D a*b, cost =3D 1 (USD/m^2), z = =3D Area*cost], [a, b, Area, cost, z]) #+end_src #+results: : [a =3D 300 m, b =3D 300 m, Area =3D 90000 m^2, cost =3D USD / m^2, z =3D = 90000 USD] --=20 : Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50=