summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-11-27 20:36:09 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-01 21:00:25 +0100
commita3e923770ef0e491b58aaac94413cba893eebcfc (patch)
tree7e536bb37d21ada66978ca3f1dcf99f883c17046 /libguile
parent6c9e8a53542019d1d207f25bfb18fbba9aabf59d (diff)
downloadguile-a3e923770ef0e491b58aaac94413cba893eebcfc.tar.gz
formally deprecate trampolines
* libguile/eval.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_trampoline_0, scm_trampoline_1) (scm_trampoline_2): Actually deprecate trampolines. * srfi/srfi-1.c: Fix all trampoline uses in srfi-1.c.
Diffstat (limited to 'libguile')
-rw-r--r--libguile/deprecated.c39
-rw-r--r--libguile/deprecated.h7
-rw-r--r--libguile/eval.c32
3 files changed, 46 insertions, 32 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index 058ebb73c..1f35d2a55 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -1573,6 +1573,45 @@ scm_gc_set_debug_check_freelist_x (SCM flag)
#endif
+/* Trampolines
+ *
+ * Trampolines were an intent to speed up calling the same Scheme procedure many
+ * times from C.
+ *
+ * However, this was the wrong thing to optimize; if you really know what you're
+ * calling, call its function directly, otherwise you're in Scheme-land, and we
+ * have many better tricks there (inlining, for example, which can remove the
+ * need for closures and free variables).
+ *
+ * Also, in the normal debugging case, trampolines were being computed but not
+ * used. Silliness.
+ */
+
+scm_t_trampoline_0
+scm_trampoline_0 (SCM proc)
+{
+ scm_c_issue_deprecation_warning
+ ("`scm_trampoline_0' is deprecated. Just use `scm_call_0' instead.");
+ return scm_call_0;
+}
+
+scm_t_trampoline_1
+scm_trampoline_1 (SCM proc)
+{
+ scm_c_issue_deprecation_warning
+ ("`scm_trampoline_1' is deprecated. Just use `scm_call_1' instead.");
+ return scm_call_1;
+}
+
+scm_t_trampoline_2
+scm_trampoline_2 (SCM proc)
+{
+ scm_c_issue_deprecation_warning
+ ("`scm_trampoline_2' is deprecated. Just use `scm_call_2' instead.");
+ return scm_call_2;
+}
+
+
void
scm_i_init_deprecated ()
{
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 4349fb851..5570a4386 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -26,6 +26,7 @@
#include "libguile/__scm.h"
#include "libguile/arrays.h"
#include "libguile/strings.h"
+#include "libguile/eval.h"
#if (SCM_ENABLE_DEPRECATED == 1)
@@ -587,6 +588,12 @@ SCM_DEPRECATED SCM scm_map_free_list (void);
SCM_DEPRECATED SCM scm_gc_set_debug_check_freelist_x (SCM flag);
#endif
+
+
+/* Deprecated 2009-11-27, scm_call_N is sufficient */
+SCM_DEPRECATED scm_t_trampoline_0 scm_trampoline_0 (SCM proc);
+SCM_DEPRECATED scm_t_trampoline_1 scm_trampoline_1 (SCM proc);
+SCM_DEPRECATED scm_t_trampoline_2 scm_trampoline_2 (SCM proc);
void scm_i_init_deprecated (void);
diff --git a/libguile/eval.c b/libguile/eval.c
index 79aa04d37..151e9ba99 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -3179,38 +3179,6 @@ SCM_DEFINE (scm_nconc2last, "apply:nconc2last", 1, 0, 0,
-/* Trampolines
- *
- * Trampolines were an intent to speed up calling the same Scheme procedure many
- * times from C.
- *
- * However, this was the wrong thing to optimize; if you really know what you're
- * calling, call its function directly, otherwise you're in Scheme-land, and we
- * have many better tricks there (inlining, for example, which can remove the
- * need for closures and free variables).
- *
- * Also, in the normal debugging case, trampolines were being computed but not
- * used. Silliness.
- */
-
-scm_t_trampoline_0
-scm_trampoline_0 (SCM proc)
-{
- return scm_call_0;
-}
-
-scm_t_trampoline_1
-scm_trampoline_1 (SCM proc)
-{
- return scm_call_1;
-}
-
-scm_t_trampoline_2
-scm_trampoline_2 (SCM proc)
-{
- return scm_call_2;
-}
-
/* Typechecking for multi-argument MAP and FOR-EACH.
Verify that each element of the vector ARGV, except for the first,