Reinhold Kainhofer <reinh...@kainhofer.com> writes: > On Mi., 17. Aug. 2011 10:19:33 CEST, David Kastrup <d...@gnu.org> wrote: >> I mean, look at the bad code I dug up. Pretty early in the list there >> was: >> - if (mode != SCM_UNDEFINED && scm_string_p (mode)) >> + if (scm_is_string (mode)) > > > Yes, that's code that should really be fixed. > > >> > If you feel compelled to change large swaths of source code by >> > substituting x == SCM_EOL with scm_is_eq(x, SCM_EOL), then I can't >> > stop you, but to me it just looks like a waste of time. >> >> That would be scm_is_null (x). It is not exactly like the code gets >> less readable by that substitution. > > Here, I agree with David, too. > If we have someone who wants to work on them and clean up some code, I > have no objection. It just probably won't fix a problem, but improves > readability and code style. > > The only proble I see with the -D compile switch is the code of > ly_symbol2scm (which is used several times in almost every file), > which does a check "if (!cached)" to see if the SCM cache has been > initialized. How should this be correctly implemented? It is not a > check for a scheme value, but builds on the guile internals of how a > SCM looks when initialized.
I already wrote that. if (!SCM_UNPACK (cached)) We already use SCM_UNPACK to access raw content when creating smobs (and it is both the only and the canonical way to do this). -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel