summaryrefslogtreecommitdiff
path: root/libguile/macros.h
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2003-05-04 08:36:56 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2003-05-04 08:36:56 +0000
commit3b88ed2a4d07d7eb7e664d12529cdab9fc8100c4 (patch)
treebaaf4541e0ff789799ac29c74d53a44d5fda074f /libguile/macros.h
parenta7b0aa508c58de7e74119e8bd8c535b442a1933c (diff)
downloadguile-3b88ed2a4d07d7eb7e664d12529cdab9fc8100c4.tar.gz
The purpose of this patch is to make guile's internal memoizers
distinguishable from memoizing macros created on the scheme level or from user provided primitive memoizing macros. The reason is, that the internal memoizers are the only ones that are allowed to transform their scheme input into memoizer byte code, while all other memoizing macros may only transform scheme code into new scheme code. To achieve this, a new macro type 'builtin-macro!' is introduced. Currently, 'builtin-macro!'s are handled as memoizing macros, but this will change when the memoizer and executor are separated. * macros.[ch] (scm_i_makbimacro): New. * macros.h (SCM_BUILTIN_MACRO_P): New. * macros.c (macro_print, scm_macro_type): Support builtin-macro!s. * eval.c, goops.c: All of guile's primitive memoizing macros are primitive builtin-macros now. * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive builtin-macros are handled equally to memoizing macros.
Diffstat (limited to 'libguile/macros.h')
-rw-r--r--libguile/macros.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/macros.h b/libguile/macros.h
index 7f9469b27..c53f21038 100644
--- a/libguile/macros.h
+++ b/libguile/macros.h
@@ -3,7 +3,7 @@
#ifndef SCM_MACROS_H
#define SCM_MACROS_H
-/* Copyright (C) 1998,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2000,2001,2002,2003 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -31,12 +31,14 @@
#define SCM_MACROP(x) SCM_TYP16_PREDICATE (scm_tc16_macro, (x))
#define SCM_MACRO_TYPE(m) (SCM_CELL_WORD_0 (m) >> 16)
+#define SCM_BUILTIN_MACRO_P(x) (SCM_MACROP (x) && SCM_MACRO_TYPE (x) == 3)
#define SCM_MACRO_CODE(m) SCM_CELL_OBJECT_1 (m)
SCM_API scm_t_bits scm_tc16_macro;
-SCM_API SCM scm_makacro (SCM code);
+SCM_API SCM scm_i_makbimacro (SCM code);
SCM_API SCM scm_makmmacro (SCM code);
+SCM_API SCM scm_makacro (SCM code);
SCM_API SCM scm_macro_p (SCM obj);
SCM_API SCM scm_macro_type (SCM m);
SCM_API SCM scm_macro_name (SCM m);