]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/module-scheme.cc
Run grand-replace (issue 3765)
[lilypond.git] / lily / module-scheme.cc
index d18e507dcdda6f95504defe09ba2737c63f3ea8b..58fc141f38c4675d7a8be002ef0036d2d7cb45b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -67,13 +67,12 @@ ly_module_lookup (SCM module, SCM sym)
 /*
   Issue 2758:
     Guile V2 onward has a scm_module_variable API module.
-    Guile V1.8.7 only has a (module-variable) REPL function.
-    Replace previous code using undocumented API calls deprecated
-      in Guile V2.
+    Guile V1.8.7 only has a (module-variable) REPL function, however
+    using ly_lily_module_constant ("module-variable") and calling
+    the memoized result is slow.
  */
 #if GUILEV1
-  static SCM module_variable_func = ly_lily_module_constant ("module-variable");
-  return scm_call_2 (module_variable_func, module, sym);
+  return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
 #else
   return scm_module_variable (module, sym);
 #endif