mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
* macros.c: Doc patches from Richard Kim. Pasted from scm.texi.
This commit is contained in:
parent
9dbcf01033
commit
07f7f249e5
1 changed files with 27 additions and 3 deletions
|
@ -54,7 +54,9 @@ long scm_tc16_macro;
|
|||
|
||||
SCM_DEFINE (scm_makacro, "procedure->syntax", 1, 0, 0,
|
||||
(SCM code),
|
||||
"")
|
||||
"Returns a @dfn{macro} which, when a symbol defined to this value\n"
|
||||
"appears as the first symbol in an expression, returns the result\n"
|
||||
"of applying @var{code} to the expression and the environment.")
|
||||
#define FUNC_NAME s_scm_makacro
|
||||
{
|
||||
SCM_VALIDATE_PROC (1,code);
|
||||
|
@ -65,7 +67,18 @@ SCM_DEFINE (scm_makacro, "procedure->syntax", 1, 0, 0,
|
|||
|
||||
SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0,
|
||||
(SCM code),
|
||||
"")
|
||||
"Returns a @dfn{macro} which, when a symbol defined to this value\n"
|
||||
"appears as the first symbol in an expression, evaluates the result\n"
|
||||
"of applying @var{code} to the expression and the environment.\n"
|
||||
"The value returned from @var{code} which has been passed to\n"
|
||||
"@code{procedure->memoizing-macro} replaces the form passed to\n"
|
||||
"@var{code}. For example:\n\n"
|
||||
"@example\n"
|
||||
"(define trace\n"
|
||||
" (procedure->macro\n"
|
||||
" (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))\n\n"
|
||||
"(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).\n"
|
||||
"@end example\n")
|
||||
#define FUNC_NAME s_scm_makmacro
|
||||
{
|
||||
SCM_VALIDATE_PROC (1,code);
|
||||
|
@ -76,7 +89,18 @@ SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0,
|
|||
|
||||
SCM_DEFINE (scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0,
|
||||
(SCM code),
|
||||
"")
|
||||
"Returns a @dfn{macro} which, when a symbol defined to this value\n"
|
||||
"appears as the first symbol in an expression, evaluates the result\n"
|
||||
"of applying @var{proc} to the expression and the environment.\n"
|
||||
"The value returned from @var{proc} which has been passed to\n"
|
||||
"@code{procedure->memoizing-macro} replaces the form passed to\n"
|
||||
"@var{proc}. For example:\n\n"
|
||||
"@example\n"
|
||||
"(define trace\n"
|
||||
" (procedure->macro\n"
|
||||
" (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))\n\n"
|
||||
"(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).\n"
|
||||
"@end example\n")
|
||||
#define FUNC_NAME s_scm_makmmacro
|
||||
{
|
||||
SCM_VALIDATE_PROC (1,code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue