[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ob-calc duplicate stack-element issue
From: |
Marco Wahl |
Subject: |
Re: ob-calc duplicate stack-element issue |
Date: |
Wed, 18 Mar 2020 17:23:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eric S Fraga <address@hidden> 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