From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Witty Subject: Large numbers of named variables in Babel Date: Thu, 7 Aug 2014 00:27:09 +1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135f730d5136404fff6c61c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF2Bz-0003qJ-NS for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 10:27:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF2By-0007nX-U1 for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 10:27:51 -0400 Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]:39198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF2By-0007nN-Pw for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 10:27:50 -0400 Received: by mail-ig0-f178.google.com with SMTP id uq10so2925912igb.5 for ; Wed, 06 Aug 2014 07:27:49 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org mailing list --001a1135f730d5136404fff6c61c Content-Type: text/plain; charset=UTF-8 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 --001a1135f730d5136404fff6c61c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I'm trying to writ= e my RPG adventures in org-mode and would like to bring character sheets in= to that fold. Is there a way in Babel to have a vast number of named variab= les 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:<= br>
#+NAME: stats
| STR | 13 |
| DEX | 12 |
| CON = | 11 |

and then later I can use that like:
#+NAME: AC=
#+begin_src python :var dex=3Dtable[DEX] :var armour=3Dtable[ARMOUR]
ret= urn 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
--001a1135f730d5136404fff6c61c--