lilypond-user
[Top][All Lists]
Advanced

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

Re: Omitting the destination on a call to format is deprecated. Pass #f


From: Jean Abou Samra
Subject: Re: Omitting the destination on a call to format is deprecated. Pass #f as the destination, before the format string.
Date: Sat, 29 Oct 2022 21:09:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

Hi Valentin,

Le 29/10/2022 à 00:42, Valentin Petzel a écrit :
Lilypond with Guile 1.8 used a less capable version of the format command that
did not feature a destination argument (the default simple-format of Guile).
With Guile 2  Lilypond uses the full, powerful ice9 format (as can be seen
using #(display format)).

ice9 format takes a destination argument as first argument. This one can be any
output port, #t for the current output port (i.e. you print the result) or #f
to return the result.


Not sure what makes you think that?

Test input:

\version "2.22.2"

#(ly:message "~s ~s ~s"
             format
             simple-format
             (@ (ice-9 format) format))


2.22 output:

#<procedure format args> #<primitive-procedure simple-format> #<procedure format args>


2.23.80 output:


#<procedure 7fe7e0088b80 at ice-9/format.scm:1609:9 (destination format-string . args) | (deprecated-format-string-only)> #<procedure simple-format (_ _ . _)> #<procedure 7fe7e0088b80 at ice-9/format.scm:1609:9 (destination format-string . args) | (deprecated-format-string-only)>



As you can see, the format procedure loaded by default in LilyPond

files is always the one from (ice-9 format).



As far as I can see, simple-format has always required a boolean or port

as first argument. As for (@ (ice-9 format) format), its first boolean

or port argument is optional in Guile 1, optional with a deprecation

warning in Guile 2, and required in Guile 3.


Best,

Jean





reply via email to

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