lilypond-devel
[Top][All Lists]
Advanced

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

as_ly_scm_list


From: Jean Abou Samra
Subject: as_ly_scm_list
Date: Mon, 25 Jul 2022 01:04:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

lily-lexer.cc contains

   for (SCM scope : as_ly_scm_list (scopes_))
     ly_use_module (module, scope);

When I read this code again after modifying it some
time ago, my reaction was "what, scopes_ will be SCM_EOL
at the end of this iteration, didn't I introduce a big
bad bug??", but inserting debug message () statements
shows that this is not true.

I understand that ly_scm_list takes an rvalue and disallows
lvalues for clarity, while as_ly_scm_list takes an lvalue,
and will fail on an rvalue by design, with the failure being
a compilation failure since e67154f7e330b61c5d9a973fbb89bd56866a148e.

But I don't understand the real difference that distinguishes
them. Before that commit, what would have been the difference
between as_ly_scm_list (lvalue) and ly_scm_list (lvalue)?

Thanks,
Jean




reply via email to

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