summaryrefslogtreecommitdiff
path: root/libguile/macros.c
diff options
context:
space:
mode:
authorGreg J. Badros <gjb@cs.washington.edu>2000-02-07 17:08:07 +0000
committerGreg J. Badros <gjb@cs.washington.edu>2000-02-07 17:08:07 +0000
commit07f7f249e5a348b8294a84d85feec7bc8677e8f3 (patch)
treec2d1e01f0d0652a56d41ef5477c1f15a1e5685f3 /libguile/macros.c
parent9dbcf010332e491726c310970421d6cc0812525e (diff)
downloadguile-07f7f249e5a348b8294a84d85feec7bc8677e8f3.tar.gz
* macros.c: Doc patches from Richard Kim. Pasted from scm.texi.
Diffstat (limited to 'libguile/macros.c')
-rw-r--r--libguile/macros.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/libguile/macros.c b/libguile/macros.c
index 9f092f327..05275a395 100644
--- a/libguile/macros.c
+++ b/libguile/macros.c
@@ -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);