1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

remove scm_makacro and scm_makmacro

* libguile/macros.h:
* libguile/macros.c (scm_makacro): Remove this function for making
  "acros", as it is unused and won't work with the compiler.
  (scm_makmacro): Remove this deprecated function for making
  non-memoizing macros, as they won't work with the compiler.
  (macro_print, scm_macro_type): Remove a couple of cases for macros
  that can't be created any more.
This commit is contained in:
Andy Wingo 2010-01-05 10:39:40 +01:00
parent ea7d717b1e
commit 9f09b127d4
2 changed files with 2 additions and 63 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003, 2006, 2008, 2009 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -56,12 +56,6 @@ macro_print (SCM macro, SCM port, scm_print_state *pstate)
if (!SCM_PROGRAM_P (code)) if (!SCM_PROGRAM_P (code))
scm_puts ("primitive-", port); scm_puts ("primitive-", port);
if (SCM_MACRO_TYPE (macro) == 0)
scm_puts ("syntax", port);
#if SCM_ENABLE_DEPRECATED == 1
if (SCM_MACRO_TYPE (macro) == 1)
scm_puts ("macro", port);
#endif
if (SCM_MACRO_TYPE (macro) == 2) if (SCM_MACRO_TYPE (macro) == 2)
scm_puts ("macro!", port); scm_puts ("macro!", port);
if (SCM_MACRO_TYPE (macro) == 3) if (SCM_MACRO_TYPE (macro) == 3)
@ -123,49 +117,6 @@ SCM_DEFINE (scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE (scm_makacro, "procedure->syntax", 1, 0, 0,
(SCM code),
"Return a @dfn{macro} which, when a symbol defined to this value\n"
"appears as the first symbol in an expression, returns the\n"
"result of applying @var{code} to the expression and the\n"
"environment.")
#define FUNC_NAME s_scm_makacro
{
SCM_VALIDATE_PROC (1, code);
return makmac (code, 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"
"appears as the first symbol in an expression, evaluates the\n"
"result of applying @var{code} to the expression and the\n"
"environment. For example:\n"
"\n"
"@lisp\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 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);
return makmac (code, 1);
}
#undef FUNC_NAME
#endif
SCM_DEFINE (scm_make_syncase_macro, "make-syncase-macro", 2, 0, 0, SCM_DEFINE (scm_make_syncase_macro, "make-syncase-macro", 2, 0, 0,
(SCM type, SCM binding), (SCM type, SCM binding),
"Return a @dfn{macro} that requires expansion by syntax-case.\n" "Return a @dfn{macro} that requires expansion by syntax-case.\n"
@ -212,10 +163,6 @@ SCM_DEFINE (scm_macro_p, "macro?", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
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_SYMBOL (scm_sym_mmacro, "macro!");
SCM_SYMBOL (scm_sym_bimacro, "builtin-macro!"); SCM_SYMBOL (scm_sym_bimacro, "builtin-macro!");
SCM_SYMBOL (scm_sym_syncase_macro, "syncase-macro"); SCM_SYMBOL (scm_sym_syncase_macro, "syncase-macro");
@ -233,10 +180,6 @@ SCM_DEFINE (scm_macro_type, "macro-type", 1, 0, 0,
return SCM_BOOL_F; return SCM_BOOL_F;
switch (SCM_MACRO_TYPE (m)) 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; case 2: return scm_sym_mmacro;
case 3: return scm_sym_bimacro; case 3: return scm_sym_bimacro;
case 4: return scm_sym_syncase_macro; case 4: return scm_sym_syncase_macro;

View file

@ -3,7 +3,7 @@
#ifndef SCM_MACROS_H #ifndef SCM_MACROS_H
#define SCM_MACROS_H #define SCM_MACROS_H
/* Copyright (C) 1998,2000,2001,2002,2003, 2006, 2008, 2009 Free Software Foundation, Inc. /* Copyright (C) 1998,2000,2001,2002,2003, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -45,7 +45,6 @@ SCM_API scm_t_bits scm_tc16_macro;
SCM_INTERNAL SCM scm_i_makbimacro (SCM code); SCM_INTERNAL SCM scm_i_makbimacro (SCM code);
SCM_API SCM scm_makmmacro (SCM code); SCM_API SCM scm_makmmacro (SCM code);
SCM_API SCM scm_makacro (SCM code);
SCM_API SCM scm_make_syncase_macro (SCM type, SCM binding); SCM_API SCM scm_make_syncase_macro (SCM type, SCM binding);
SCM_API SCM scm_make_extended_syncase_macro (SCM builtin, SCM type, SCM_API SCM scm_make_extended_syncase_macro (SCM builtin, SCM type,
SCM binding); SCM binding);
@ -60,9 +59,6 @@ SCM_API SCM scm_make_synt (const char *name,
SCM (*fcn) ()); SCM (*fcn) ());
SCM_INTERNAL void scm_init_macros (void); SCM_INTERNAL void scm_init_macros (void);
#if SCM_ENABLE_DEPRECATED == 1
SCM_DEPRECATED SCM scm_makmacro (SCM code);
#endif
#endif /* SCM_MACROS_H */ #endif /* SCM_MACROS_H */