Thomas Morley <thomasmorle...@gmail.com> writes:

> Am Do., 11. Okt. 2018 um 20:17 Uhr schrieb Karlin High <karlinh...@gmail.com>:
>>
>> On 10/11/2018 12:59 PM, David Kastrup wrote:
>> > we should be able to add code that will run under all versions.
>>
>> The guile-devel post linked in the OP indicates that Guile 3 should have
>> greatly improved performance over Guile 2. Maybe even better than
>> LilyPond's current Guile 1.8.
>>
>> What level of optimism is appropriate for that claim?
>> --
>> Karlin High
>> Missouri, USA
>
> Well, I'll test that as soon as I have more success with 'make doc'.
> For now I've deleted said regtest and test how far it will go...

Could you reinstate the regtest and try this untested patch?  Not
necessarily in that order since, well, the patch might well not even
compile.  Or work correctly.

>From 6d974c4990f2bb4c34605908ba3b7ca1c21487cf Mon Sep 17 00:00:00 2001
From: David Kastrup <d...@gnu.org>
Date: Thu, 11 Oct 2018 20:52:19 +0200
Subject: [PATCH] Use different `values' implementation of Guilev2

---
 lily/lexer.ll | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lily/lexer.ll b/lily/lexer.ll
index 421fea2734..f893715e8e 100644
--- a/lily/lexer.ll
+++ b/lily/lexer.ll
@@ -1107,6 +1107,13 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token)
 
 	if (extra_token && SCM_VALUESP (sval))
 	{
+#if GUILEV2
+		size_t nvals = scm_c_nvalues (sval);
+
+		if (nvals > 0) {
+			while (--nvals) {
+				SCM v = scm_c_value_ref (sval, nvals);
+#else
 		sval = scm_struct_ref (sval, SCM_INUM0);
 
 		if (scm_is_pair (sval)) {
@@ -1115,6 +1122,7 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token)
 			     p = scm_cdr (p))
 			{
 				SCM v = scm_car (p);
+#endif
 				if (Music *m = unsmob<Music> (v))
 				{
 					if (!unsmob<Input> (m->get_property ("origin")))
@@ -1135,7 +1143,11 @@ Lily_lexer::eval_scm (SCM readerdata, Input hi, char extra_token)
 					break;
 				}
 			}
+#if GUILEV2
+			sval = scm_c_value_ref (sval, 0);
+#else
 			sval = scm_car (sval);
+#endif
 		} else
 			sval = SCM_UNSPECIFIED;
 	}
-- 
2.17.1


-- 
David Kastrup
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to