emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Heiko Schmidt <Heiko.Schmidt@webbedtables.de>
To: emacs-orgmode@gnu.org
Subject: Re: ob-calc duplicate stack-element issue
Date: Mon, 6 Apr 2020 06:16:42 +0200	[thread overview]
Message-ID: <55c27db6-2a01-8592-dc01-664fef1ea8ef@webbedtables.de> (raw)
In-Reply-To: <84fte5lnyd.fsf@gmail.com>

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
> 45e6
> #+end_src
> Yearly mileage in [km/y]
> #+name: mileage
> #+begin_src calc :exports both
> 15000
> #+end_src
> Calculate amount of complete km per year
> #+begin_src calc :noweb yes
> <<numcars>>
> <<mileage>>
> '*
> #+end_src
> --8<---------------cut here---------------end--------------->8---
> HTH,
> -- Marco
 From my point of view "variablizing" distracts me to much. I'd prefer 
more to comment via "literate" description of the numbers.

      parent reply	other threads:[~2020-04-06  4:32 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
2020-03-18 16:41       ` Eric S Fraga
2020-04-06  4:39     ` Heiko Schmidt
2020-04-06  4:16   ` Heiko Schmidt [this message]

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:

  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=55c27db6-2a01-8592-dc01-664fef1ea8ef@webbedtables.de \
    --to=heiko.schmidt@webbedtables.de \
    --cc=emacs-orgmode@gnu.org \


* 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


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