Re: ob-calc duplicate stack-element issue

2020-04-05 Thread Heiko Schmidt
On 18.03.20 16:50, Eric S Fraga wrote: 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

Re: ob-calc duplicate stack-element issue

2020-04-05 Thread Heiko Schmidt
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

Re: ob-calc duplicate stack-element issue

2020-03-18 Thread Eric S Fraga
On Wednesday, 18 Mar 2020 at 17:23, Marco Wahl wrote: > 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. Could be. Indeed, at the moment, if you

Re: ob-calc duplicate stack-element issue

2020-03-18 Thread Marco Wahl
Eric S Fraga 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.

Re: ob-calc duplicate stack-element issue

2020-03-18 Thread Eric S Fraga
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.

Re: ob-calc duplicate stack-element issue

2020-03-18 Thread Marco Wahl
Heiko Schmidt writes: > - problem: When evaluating the calc snippets the top of stack element >   is dropped. Because every "begin/end_src calc" block drops the top >   of stack, one can't reuse the result in following blocks. > Number of cars (PKW) in germany: > > #+begin_src calc :exports

Re: ob-calc duplicate stack-element issue

2020-03-15 Thread Heiko Schmidt
Several times I made exactly similar experiences with ob-calc as you mentioned (units, do what I want), nevertheless I decided to be dependent of orgmode and I'd really appreciate to use ob-calc for "literate calculation". "Embedded calc" seems interesting but I refuse using more tools or

Re: ob-calc duplicate stack-element issue

2020-03-15 Thread Eric S Fraga
On Sunday, 15 Mar 2020 at 11:46, Heiko Schmidt wrote: > - I want to use ob-calc to do some "literate calculation" with the >   purpose to document what I thought at the time I wrote it. I have never managed to get ob-calc to do what I want either so I cannot help you directly with your query.