From ef928f026365793675ca91cbbe2007ee8a4075b7 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 17 Aug 2014 15:52:19 +0200 Subject: [PATCH] Issue 4069: Rewrite ly_lily_module_constant in terms of scm_c_module_lookup Overusing eval is not desirable. --- lily/include/lily-guile-macros.hh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index acc817f878..1bdf9aa7bc 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -81,8 +81,6 @@ inline SCM ly_symbol2scm (char const *x) { return scm_from_locale_symbol ((x)); #endif /* - TODO: rename me to ly_c_lily_module_eval - we don't have to protect the result; it's already part of the exports list of the module. */ @@ -95,11 +93,12 @@ inline SCM ly_symbol2scm (char const *x) { return scm_from_locale_symbol ((x)); if (__builtin_constant_p ((x))) \ { \ if (!cached) \ - value = cached = scm_eval (scm_from_locale_symbol (x), \ - global_lily_module); \ + value = cached = \ + scm_variable_ref (scm_c_module_lookup (global_lily_module, (x))); \ } \ else \ - value = scm_eval (scm_from_locale_symbol (x), global_lily_module); \ + value = \ + scm_variable_ref (scm_c_module_lookup (global_lily_module, (x))); \ value; \ }) -- 2.39.5