From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms98 with LMTPS id 0OojIfKwil4RCAAAGDD2mg (envelope-from ) for ; Mon, 06 Apr 2020 04:32:50 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cPgHA/Kwil5ICwAAbx9fmQ (envelope-from ) for ; Mon, 06 Apr 2020 04:32:50 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 01EAA682774 for ; Mon, 6 Apr 2020 04:17:28 +0000 (UTC) Received: from localhost ([::1]:54434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLJCP-0004Nv-Sm for larch@yhetil.org; Mon, 06 Apr 2020 00:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38973) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLJBt-0004NP-Lv for emacs-orgmode@gnu.org; Mon, 06 Apr 2020 00:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLJBs-0000Lh-Ii for emacs-orgmode@gnu.org; Mon, 06 Apr 2020 00:16:53 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:52507) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jLJBs-0000BX-8r for emacs-orgmode@gnu.org; Mon, 06 Apr 2020 00:16:52 -0400 Received: from mail.home.webbedtables.de ([178.2.225.23]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M5Qhx-1jMg6I1zwD-001NqN for ; Mon, 06 Apr 2020 06:16:43 +0200 Received: from [192.168.2.21] (cheetah2.fritz.box [192.168.2.21]) by mail.home.webbedtables.de (Postfix) with ESMTP id 7088283B5D for ; Mon, 6 Apr 2020 06:16:42 +0200 (CEST) Subject: Re: ob-calc duplicate stack-element issue To: emacs-orgmode@gnu.org References: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> <84fte5lnyd.fsf@gmail.com> From: Heiko Schmidt Message-ID: <55c27db6-2a01-8592-dc01-664fef1ea8ef@webbedtables.de> Date: Mon, 6 Apr 2020 06:16:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <84fte5lnyd.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Provags-ID: V03:K1:awqwMSBQfJLcDx8fqgoqeB0H5Nj08uwjN4pPS9bnvFpolPtV2My k/x4aG5yGCapAcwoxCPveGlyO6rIsWZB9/kxe0+Uo9Z/sridMJSsgWyB079lNolpo3x3H50 o0eAKlY2lNFjUYhlbRNsGDcqWO1jOVU7jpFUipyjZN1ckc1/RYxyBN6RFrNyTRPWYNWMBVM 3S+/cq8B6XOu1jmpii0lg== X-UI-Out-Filterresults: notjunk:1;V03:K0:OhyC2yz9oIM=:png8KAM8z3p8Fy2LnwJO/N SuI7QE1nyRUB3Zfq81u2PLf9p+8mjz965VswDCBLSAwF0fNK8uv3fWmL+cmXNysRLnLRXiQk/ eb2GWZoGQyY5pFz1ccTdN0o+zWZJktuK7Lj0ntToeEW/x5HKaZCxlHVqp4TJ9QNPm1EDdMR2J STCTm7YtpYqeZgmzaf43wsZktNNVd6smfGz9RaH39WFJNV2QGlXAdSwwZYwlQUyzpCFcrrY2h 3Jz1j11sRjteuB4Ij/ySU2ZjZGP68hGLYs23AHv5qJZktXvFp1zduQtWfqOYrKBayMwWUfRmI 0ozkP/9b6v6MAoUPAkcOMGo/Zmp4yc4277xwQIKVc0TxeLGhO/9hwleYovFlsZrGuhycl1iu0 6nAx/CHO/6aI5CgRjEnaBHwbGx3JzWV5BMNEk2uLBm2BXH0kgQj/z6TXkBNIKocQib08vjzx7 0H8fvx8srOOwUigb2v6yg95R0sRw4ol/3ex1znUQsl3nB8ihBBpHTDOFXw+u9YlK5SXxyVnt0 usHmyDpM0OY2gQ/dtMVL7XQU1vKZ+S/Fy7V+Cm0TK+CgZ0VuV44hbXCiUQmPkbNKBdSTflLKf 3oX0qpCpOahuEiovFX737YdrrT+NEJgKIXUe7yXK1BzNcxQk8Gv+14HvIH1KipxWLVVeyWS6g K9yw3TCLbljXb/txxGokJgLg6FhUaIe9AipfodwsIjhKyMntV7G+6opBk4/nNmg6wk8/rmyVv +zapmAP7GBT6GffTv2lgBH6W7zr26YZzbioMAcJgv0Mr/m/wXYkMQz8lJgFdDMHS2SPvkgFo0 qa22qhVzwM21d/zbbOxhkmHCceysQ1sr4Sby8EAHAVWOFlqxbrno8vLfiiMZUN05U0UErUt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=default; t=1586146649; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=ecYr5byW99bgCrpvNTN3n0dyAgAGBHs4m4T96hLmfjE=; b=hig8QiAc6AuvmmqSqnSl9DrCgF3IG7nY5pALZoE60JTL6AjpC2/J7KTSKCz4Lh/5DoO//V gHmTZ/5ckLPzaEhk6NvVp2MqP53GpyVFZ36wo9P88rcmgRaSpyZF+WxL1DkRiYpSly0dhf hWW2hyXoViot8fMbwKGRFgIfNAYTWjI= ARC-Seal: i=1; s=default; d=yhetil.org; t=1586146649; a=rsa-sha256; cv=none; b=G/TaCY5lrydx4u+pXdxwyMrs5Q1KBlVdMGxOjOS/lSEmubQPQBb4A/aA1uhB7w2oAlrTSG tMGJvpsJHuNhC1Fli63hSH+RG0SbSeuv4Xxi/X3IcqZLJC45QRlN2yLAd7H0PIKYHtU+yI nw2ZOjZqQNvWklzqTEszymOkaYIa3cg= ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx2.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx2.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.58434200098848]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.33), country: US(-0.01), ip: 209.51.188.17(-0.58)]; TO_DN_NONE(0.00)[]; ARC_SIGNED(0.00)[i=1]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[Heiko.Schmidt@webbedtables.de,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; DMARC_NA(0.00)[webbedtables.de]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: VrBHHZd4x0yV Hi Marco, On 18.03.20 15:47, Marco Wahl wrote: > Okay. I take here the "any advice is appreciated" part. > AFAICS at the org babel calc evaluation the last value of the calc stack > gets dropped. > > So your workaround is okay, I think. You can just write any dummy > element at the bottom of each block e.g. just 0. No need of > duplication. Looks a bit hackish to me but so what? Oh no. You're completely right. This simplifying clarification is already quite helpful. Just putting 0 on top of stack is enough. Terrifying simple. > Another approach could be "noweb". Example (you would just evaluate the > block at the bottom): > > --8<---------------cut here---------------start------------->8--- > Number of cars (PKW) in germany: > > #+name: numcars > #+begin_src calc :exports both > 45e6 > #+end_src > > Yearly mileage in [km/y] > > #+name: mileage > #+begin_src calc :exports both > 15000 > #+end_src > > Calculate amount of complete km per year > > #+begin_src calc :noweb yes > <> > <> > '* > #+end_src > --8<---------------cut here---------------end--------------->8--- > > > HTH, > -- Marco > From my point of view "variablizing" distracts me to much. I'd prefer more to comment via "literate" description of the numbers.