lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ly_scm_write_string: call scm_write directly (issue 545450043 by add


From: hanwenn
Subject: Re: ly_scm_write_string: call scm_write directly (issue 545450043 by address@hidden)
Date: Fri, 24 Jan 2020 09:21:22 -0800

Reviewers: dak, thomasmorley651,


https://codereview.appspot.com/545450043/diff/583370043/lily/lily-guile.cc
File lily/lily-guile.cc (right):

https://codereview.appspot.com/545450043/diff/583370043/lily/lily-guile.cc#newcode55
lily/lily-guile.cc:55: scm_write(s, port);
On 2020/01/18 23:29:30, dak wrote:
> Well, I was "what the Dickens?" reading this.  I suppose the original
purpose of
> the code is to follow redefinitions of "write".  I cannot imagine that
to be
> overly useful, though.

I think the original code may have been from a time we didn't really
understand GUILE.

Description:
ly_scm_write_string: call scm_write directly

Previously, this tried to get at the write function by evaluating
'write, which caused a hang on Guile 2.0

Please review this at https://codereview.appspot.com/545450043/

Affected files (+1, -5 lines):
  M lily/lily-guile.cc


Index: lily/lily-guile.cc
diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc
index 
54e5e4a22d7934fc46aadd6b5ed023d6ddd8b20c..cd9213a252b350844d7eac6cf0937c2c4c3db3ed
 100644
--- a/lily/lily-guile.cc
+++ b/lily/lily-guile.cc
@@ -52,11 +52,7 @@ ly_scm_write_string (SCM s)
                             scm_make_string (SCM_INUM0, SCM_UNDEFINED),
                             SCM_OPN | SCM_WRTNG,
                             "ly_write2string");
-  //  SCM write = scm_eval_3 (ly_symbol2scm ("write"), s, SCM_EOL);
-  SCM write = scm_primitive_eval (ly_symbol2scm ("write"));
-
-  // scm_apply (write, port, SCM_EOL);
-  scm_call_2 (write, s, port);
+  scm_write(s, port);
   return ly_scm2string (scm_strport_to_string (port));
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]