mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 08:10:17 +02:00
* eval.c (SCM_CEVAL), macros.c (macro_print, scm_makmacro,
scm_sym_macro, scm_macro_type), macros.h (scm_makmacro): Deprecated the special kind of built-in dynamic syntax transformer that was inaccurately named "macro". Note: The built-in syntax transformers that are named "mmacro" or "memoizing-macro" still exist, and it is these which come much closer to what one would call a macro.
This commit is contained in:
parent
4c5f8e8fe0
commit
3063e30a6d
5 changed files with 47 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -72,8 +72,10 @@ macro_print (SCM macro, SCM port, scm_print_state *pstate)
|
|||
|
||||
if (SCM_MACRO_TYPE (macro) == 0)
|
||||
scm_puts ("syntax", port);
|
||||
else if (SCM_MACRO_TYPE (macro) == 1)
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
if (SCM_MACRO_TYPE (macro) == 1)
|
||||
scm_puts ("macro", port);
|
||||
#endif
|
||||
if (SCM_MACRO_TYPE (macro) == 2)
|
||||
scm_puts ("macro!", port);
|
||||
scm_putc (' ', port);
|
||||
|
@ -110,6 +112,8 @@ SCM_DEFINE (scm_makacro, "procedure->syntax", 1, 0, 0,
|
|||
#undef FUNC_NAME
|
||||
|
||||
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
|
||||
SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0,
|
||||
(SCM code),
|
||||
"Return a @dfn{macro} which, when a symbol defined to this value\n"
|
||||
|
@ -125,11 +129,18 @@ SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0,
|
|||
"@end lisp")
|
||||
#define FUNC_NAME s_scm_makmacro
|
||||
{
|
||||
scm_c_issue_deprecation_warning
|
||||
("The function procedure->macro is deprecated, and so are"
|
||||
" non-memoizing macros in general. Use memoizing macros"
|
||||
" or r5rs macros instead.");
|
||||
|
||||
SCM_VALIDATE_PROC (1,code);
|
||||
SCM_RETURN_NEWSMOB (scm_tc16_macro | (1L << 16), SCM_UNPACK (code));
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
SCM_DEFINE (scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0,
|
||||
(SCM code),
|
||||
|
@ -161,7 +172,9 @@ SCM_DEFINE (scm_macro_p, "macro?", 1, 0, 0,
|
|||
|
||||
|
||||
SCM_SYMBOL (scm_sym_syntax, "syntax");
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
SCM_SYMBOL (scm_sym_macro, "macro");
|
||||
#endif
|
||||
SCM_SYMBOL (scm_sym_mmacro, "macro!");
|
||||
|
||||
SCM_DEFINE (scm_macro_type, "macro-type", 1, 0, 0,
|
||||
|
@ -178,7 +191,9 @@ SCM_DEFINE (scm_macro_type, "macro-type", 1, 0, 0,
|
|||
switch (SCM_MACRO_TYPE (m))
|
||||
{
|
||||
case 0: return scm_sym_syntax;
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
case 1: return scm_sym_macro;
|
||||
#endif
|
||||
case 2: return scm_sym_mmacro;
|
||||
default: scm_wrong_type_arg (FUNC_NAME, 1, m);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue