mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 00:30:21 +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
12
NEWS
12
NEWS
|
@ -95,6 +95,12 @@ when evaluated and simply be ignored in a definition context.
|
|||
|
||||
Use `substring-move!' instead.
|
||||
|
||||
** Deprecated: procedure->macro
|
||||
|
||||
Change your code to use either procedure->memoizing-macro or, probably better,
|
||||
to use r5rs macros. Also, be aware that macro expansion will not be done
|
||||
during evaluation, but prior to evaluation.
|
||||
|
||||
* Changes to the C interface
|
||||
|
||||
** The struct scm_cell has been renamed to scm_t_cell
|
||||
|
@ -159,6 +165,12 @@ instead.
|
|||
|
||||
Use scm_c_source_property_breakpoint_p instead.
|
||||
|
||||
** Deprecated: scm_makmacro
|
||||
|
||||
Change your code to use either scm_makmmacro or, probably better, to use r5rs
|
||||
macros. Also, be aware that macro expansion will not be done during
|
||||
evaluation, but prior to evaluation.
|
||||
|
||||
** Removed from scm_root_state: def_inp, def_outp, def_errp, together
|
||||
with corresponding macros scm_def_inp, scm_def_outp and scm_def_errp.
|
||||
These were undocumented and unused copies of the standard ports at the
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
2002-07-15 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* 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.
|
||||
|
||||
2002-07-13 Neil Jerram <neil@ossau.uklinux.net>
|
||||
|
||||
* eval.c (unmemocopy): Fix for
|
||||
|
|
|
@ -2290,8 +2290,7 @@ dispatch:
|
|||
SCM variable = SCM_CAR (x);
|
||||
if (SCM_ILOCP (variable))
|
||||
location = scm_ilookup (variable, env);
|
||||
else
|
||||
if (SCM_VARIABLEP (variable))
|
||||
else if (SCM_VARIABLEP (variable))
|
||||
location = SCM_VARIABLE_LOC (variable);
|
||||
else /* (SCM_SYMBOLP (variable)) is known to be true */
|
||||
location = scm_lookupcar (x, env, 1);
|
||||
|
@ -2754,6 +2753,7 @@ dispatch:
|
|||
SCM_ALLOW_INTS;
|
||||
PREP_APPLY (SCM_UNDEFINED, SCM_EOL);
|
||||
goto loop;
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
case 1:
|
||||
x = arg1;
|
||||
if (SCM_NIMP (x))
|
||||
|
@ -2763,6 +2763,7 @@ dispatch:
|
|||
}
|
||||
else
|
||||
RETURN (arg1);
|
||||
#endif
|
||||
case 0:
|
||||
RETURN (arg1);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef SCM_MACROS_H
|
||||
#define SCM_MACROS_H
|
||||
|
||||
/* Copyright (C) 1998,2000,2001 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 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
|
||||
|
@ -60,7 +60,6 @@
|
|||
SCM_API scm_t_bits scm_tc16_macro;
|
||||
|
||||
SCM_API SCM scm_makacro (SCM code);
|
||||
SCM_API SCM scm_makmacro (SCM code);
|
||||
SCM_API SCM scm_makmmacro (SCM code);
|
||||
SCM_API SCM scm_macro_p (SCM obj);
|
||||
SCM_API SCM scm_macro_type (SCM m);
|
||||
|
@ -71,6 +70,10 @@ SCM_API SCM scm_make_synt (const char *name,
|
|||
SCM (*fcn) ());
|
||||
SCM_API void scm_init_macros (void);
|
||||
|
||||
#if SCM_ENABLE_DEPRECATED == 1
|
||||
SCM_API SCM scm_makmacro (SCM code);
|
||||
#endif
|
||||
|
||||
#endif /* SCM_MACROS_H */
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue