Description Usage Arguments Value Author(s) See Also
This just places a wrapper around the function that un-quotes all arguments and evaluates the result.
1 |
fn |
A function which takes some arguments and returns a trane |
cache |
Whether to store already-compiled macros for faster evaluation. Defaults to TRUE. This requires that the macro function be a pure function not referring to any outside state. |
JIT |
Whether to compile expressions (using the "compiler" package) before executing. Defaults to TRUE if "cache" is true. |
the wrapper function. It will have an identical argument list to the wrapped function. It will transform all arguments into expressions, pass the expressions to the wrapped function, then evaluate the result it gets back.
The advantage of macros versus usual nonstandard evaluation using
substitute
, link{eval}
and friends
is that it encourages separating "computing on
the language" from "computing on the data." Because code is usually
static while data is variable, the language transformations only need
to happen once per each call site.
Thus the expansions of macros can be cached, enabling complicated code
transformations with smaller performance penalties.
Peter Meilstrup
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.