emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Brett Witty <brettwitty@brettwitty.net>
To: Org mailing list <emacs-orgmode@gnu.org>
Subject: Large numbers of named variables in Babel
Date: Thu, 7 Aug 2014 00:27:09 +1000	[thread overview]
Message-ID: <CANK_Tn-JrqP9XvKGCvDjuGR_qJjEAAWjtHooGEYAkRqb8BTHEg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

Hi,

I'm trying to write my RPG adventures in org-mode and would like to bring
character sheets into that fold. Is there a way in Babel to have a vast
number of named variables that I can feed into source blocks? Are macros
the way to achieve this?

As an example, I'd like something like a big (hidden) table:
#+NAME: stats
| STR | 13 |
| DEX | 12 |
| CON | 11 |

and then later I can use that like:
#+NAME: AC
#+begin_src python :var dex=table[DEX] :var armour=table[ARMOUR]
return dex + armour
#+end_src

I know I can make explicit cell references, but it'd be neat to just use
keys for values.

Cheers,

BrettW

[-- Attachment #2: Type: text/html, Size: 835 bytes --]

             reply	other threads:[~2014-08-06 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 14:27 Brett Witty [this message]
2014-08-06 15:15 ` Large numbers of named variables in Babel John Kitchin

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=CANK_Tn-JrqP9XvKGCvDjuGR_qJjEAAWjtHooGEYAkRqb8BTHEg@mail.gmail.com \
    --to=brettwitty@brettwitty.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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