emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: e.fraga@ucl.ac.uk
Cc: Heiko Schmidt <Heiko.Schmidt@webbedtables.de>, emacs-orgmode@gnu.org
Subject: Re: ob-calc duplicate stack-element issue
Date: Wed, 18 Mar 2020 17:23:39 +0100	[thread overview]
Message-ID: <8436a5ljhw.fsf@gmail.com> (raw)
In-Reply-To: <87fte57jd2.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Wed, 18 Mar 2020 15:50:17 +0000")

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> 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.

Possibly the originators thought about the typical use of calc blocks as
units which reduce to the top element of the stack.  In this case the
calc-pop would be the right step to clean the stack.

Just another thought.


Ciao,
-- Marco

  reply	other threads:[~2020-03-18 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 10:46 ob-calc duplicate stack-element issue Heiko Schmidt
2020-03-15 12:06 ` Eric S Fraga
2020-03-15 15:08   ` Heiko Schmidt
2020-03-18 14:47 ` Marco Wahl
2020-03-18 15:50   ` Eric S Fraga
2020-03-18 16:23     ` Marco Wahl [this message]
2020-03-18 16:41       ` Eric S Fraga
2020-04-06  4:39     ` Heiko Schmidt
2020-04-06  4:16   ` Heiko Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8436a5ljhw.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=Heiko.Schmidt@webbedtables.de \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).