From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: ob-calc duplicate stack-element issue Date: Wed, 18 Mar 2020 15:50:17 +0000 Message-ID: <87fte57jd2.fsf@ucl.ac.uk> References: <9eed12f5-face-eb4f-4006-e8ee7890e0a9@webbedtables.de> <84fte5lnyd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45206) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEaxb-0003Ru-Mq for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 11:50:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEaxa-0000E7-Jt for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 11:50:23 -0400 Received: from mail-eopbgr10093.outbound.protection.outlook.com ([40.107.1.93]:51342 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jEaxa-0008V6-7f for emacs-orgmode@gnu.org; Wed, 18 Mar 2020 11:50:22 -0400 In-Reply-To: <84fte5lnyd.fsf@gmail.com> (Marco Wahl's message of "Wed, 18 Mar 2020 15:47:22 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Marco Wahl Cc: Heiko Schmidt , emacs-orgmode@gnu.org On Wednesday, 18 Mar 2020 at 15:47, Marco Wahl wrote: > 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? Indeed hackish. But it does beg the question: why does ob-calc pop the stack? I cannot see any use case given that the stack is essentially infinite and can be safely ignored (in most if not all cases). Could the solution be to simply remove the =(calc-pop 1)= line at the end of =org-babel-execute:calc= function? Just a thought. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-432-g73bd24