Eric S Fraga <e.fr...@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