[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ob-calc duplicate stack-element issue

From: Heiko Schmidt
Subject: Re: ob-calc duplicate stack-element issue
Date: Mon, 6 Apr 2020 06:16:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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 e.g. just 0.  No need of
duplication.  Looks a bit hackish to me but so what?
Oh no. You're completely right. This simplifying clarification is already quite helpful. Just putting 0 on top of stack is enough. Terrifying simple.
Another approach could be "noweb".  Example (you would just evaluate the
block at the bottom):

--8<---------------cut here---------------start------------->8---
Number of cars (PKW) in germany:

#+name: numcars
#+begin_src calc :exports both

Yearly mileage in [km/y]

#+name: mileage
#+begin_src calc :exports both

Calculate amount of complete km per year

#+begin_src calc :noweb yes
--8<---------------cut here---------------end--------------->8---

-- Marco

From my point of view "variablizing" distracts me to much. I'd prefer more to comment via "literate" description of the numbers.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]