[Top][All Lists]

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

Re: Updating alists (was: Tenuto marking too close to note)

From: Jean Abou Samra
Subject: Re: Updating alists (was: Tenuto marking too close to note)
Date: Fri, 31 Dec 2021 00:03:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

Le 30/12/2021 à 23:04, Lukas-Fabian Moser a écrit :
Hi Jean,

Both of these cases seem to work the same as in
current versions if I do


 assq_tail (SCM key, SCM alist, SCM based_on = SCM_EOL)
-  for (SCM p = alist; !scm_is_eq (p, based_on); p = scm_cdr (p))
+  for (SCM p = alist; scm_is_pair (p) && scm_is_pair (scm_car (p)) && !scm_is_eq (p, based_on); p = scm_cdr (p))
       if (scm_is_eq (scm_caar (p), key))
         return p;

Thanks! This seems to be a sensible precaution anyway, as it only changes a certain crash into returning #f. So it might be sensible to make this change anyway?

Turns out that you can already trigger the
crash in current versions with

\version "2.23.5"

x = 0
x.y.z = 1

So, yes, it might be sensible.

But I really don't have deep enough an insight on this code
to judge, sorry.

I'm a bit surprised about the remark in the code stating that the choice not to coalesce multiple override's was made to save the cost of detecting them, as it does not seem to be a code path used heavily at all.

As someone with usually bad intuition about
performance, I would just benchmark the


reply via email to

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