[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Referring to an Org Babel variable in the invocation arguments t
Charles C. Berry
Re: [O] Referring to an Org Babel variable in the invocation arguments to another Org Babel code block
Sun, 1 Jan 2017 10:51:38 -0800
Alpine 2.20 (OSX 67 2015-01-07)
On Sun, 1 Jan 2017, Zack Piper wrote:
I tried "c", and it gives me:
as the result.
I would like it to use the _variable_ "c", not the literal string.
So the result should be ">>> test <<<"
You mean you want to use the `name' of one `:var name=assign' argument
in the `assign' part of another --- something like what `let*' does in
But you simply cannot do that.
`(info "(org) var")' tells us what you can do:
The following syntax is used to pass arguments to `src' code blocks
using the `:var' header argument.
The `assign' is a literal value, such as a string `"string"', a number
`9', a reference to a table, a list, a literal example, another code
block (with or without arguments), or the results from evaluating a
The `name' of one argument is none of these (regardless of its effect when
the body of the src block is executed, which BTW depends on the src block
There are other approaches that might serve a purpose in babel src blocks
like that served by `let*' in lisp:
- putting variables in a table (possibly invoking `org-sbe' in a
formula) and then referencing table cells
- writing other src blocks to handle the preliminary processing and
- writing an elisp src block that does those preliminaries (perhaps
using `org-babel-ref-resolve' to call other src blocks), then builds
a string specifying a call to your shell src block and calls it
- using a noweb reference that executes another src block (or blocks).
- setting property values and referencing them
You might have better luck getting guidance on a useful approach by
trying to describe what you want to accomplish.