Description Usage Arguments Details Value See Also
These two functions create Lisp-style macros. macro
creates and
returns anonymous macros; defmacro is a convenience wrapper around
macro
which creates a macro and assigns it to a name in the current
environment. A full discussion of macros and how to use them is beyond the
scope of this page; see the vignettes for an R-focused introduction.
1 2 3 |
nm |
The symbol to which |
params |
A parameter list, which when coerced to pairlist is acceptable to the "function" constructor function. |
... |
Body statements. |
Even though R is descended from Scheme, the macros implemented here are based on the "non-hygienic" ones used in Common Lisp. They contrast with the hygienic form that's traditional in Scheme, which is based on syntax objects and the syntax-case special form.
macro
returns the created macro, which is an R function.
defmacro
, as in Common Lisp, returns the symbol it's bound the new
macro to.
The gensym
function, which generates temporary unique symbols
that macro definitions can use to avoid capturing variables from the calling
environment.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.