diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2000-01-07 23:33:29 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2000-01-07 23:33:29 +0000 |
commit | 73d8385e9fb718d182935494a8dbceb8812a6467 (patch) | |
tree | 1214fd6093dc6e147cae8c0aad33cbf655f14006 | |
parent | 4b4d0898a6836f499b7b7e27b11285dcd1bf3166 (diff) | |
download | guile-73d8385e9fb718d182935494a8dbceb8812a6467.tar.gz |
* snarf.h (SCM_INSITU, SCM_INIT): Resurrected.
-rw-r--r-- | libguile/snarf.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libguile/snarf.h b/libguile/snarf.h index a87937992..93c171ae1 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -51,15 +51,6 @@ -/* Generic macros to be used in user macro definitions. - * - * For example, the SCM_PROC macro could have been defined by the user: - * - * #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ - * SCM_NOTSNARF (static const char RANAME[]=STR) \ - * SCM_SNARFING (scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) CFN)) - */ - #if defined(__cplusplus) || defined(GUILE_CPLUSPLUS_SNARF) #define SCM_FUNC_CAST_ARBITRARY_ARGS SCM (*)(...) #else @@ -74,6 +65,21 @@ # define SCM_SNARFING(X) X #endif +/* Generic macros to be used in user macro definitions. + * + * For example, in order to define a macro which creates ints and + * initializes them to the result of foo (), do: + * + * #define SCM_FOO(NAME) \ + * SCM_INSITU (int NAME) \ + * SCM_INIT (NAME = foo ()) + */ + +#define SCM_INSITU(X) SCM_NOTSNARF(X) +#define SCM_INIT(X) SCM_SNARFING(\ +%%% X \ +) + #define SCM_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \ SCM_NOTSNARF(\ static const char s_ ## FNAME [] = PRIMNAME; \ |