Le 15/01/2023 à 20:20, Graham King a écrit :
I've just run convert-ly on a 600+ line file and its \include files, from 2.19.40 to 2.25.0. Nothing seemed to change apart from the \version statement, but on trying to compile the file, I get:Processing `/tmp/....ly' Parsing...ERROR: In procedure %resolve-variable: Unbound variable: % Exited with return code 1. Does this point to an obvious problem?
You probably tried to use LilyPond comment syntax in a Scheme function. Scheme comments start with ';' not '%'. With Guile 1, as used in LilyPond 2.22, it happens that #(define (func) % a bunch of unbound variables 'x) #(display (func)) "works" and prints "x". This is weird. The function body has several expressions: %, a, ..., 'x, where all the ones before 'x are references to variables called '%', 'a', ... In Scheme, the expressions before the last one in a function body are evaluated only for their side effects, the result is discarded. It seems that Guile 1 somehow detects that a simple variable can't have a side effect and removes it, even though it would trigger an error if it were evaluated. We're on Guile 2 now, and it doesn't have this obscure behavior. Best, Jean
OpenPGP_signature
Description: OpenPGP digital signature
