Re: bizarre behaviour of `output-filename`
>> Some debugging shows it seems to be the latter: All top-level >> definitions are available as paper variables within a book's paper >> block, together with all paper variables of the top-level paper >> block: >> >> Is this really intentional? > > https://gitlab.com/lilypond/lilypond/-/issues/5917 > https://codereview.appspot.com/567450043 Really? I would never have expected that this quite innocent-looking patch makes top-level definitions (outside of any block) available as paper variables within `\book`. The comment in `book.cc` only talks about `\header` blocks. How does this influence stuff outside of `\header`? And how does it influence `\paper`? In case this patch is really the cause, can the behaviour be restricted to `\header` blocks as announced in the commit message? Werner
PATCHES - Countdown to October 23
Here is the current countdown report. The next countdown will begin on October 23rd. A list of all merge requests can be found here: https://gitlab.com/lilypond/lilypond/-/merge_requests?sort=label_priority Push: !2142 NR: Document `text-font-size` paper variable - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2142 !2141 New command-line option `-dstaff-size` - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2141 !2140 Correctly align lyrics on split notes - Thomas Morley https://gitlab.com/lilypond/lilypond/-/merge_requests/2140 !2139 paper.scm: Add docstrings to `set-default-paper-size` and `set-paper-size` - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2139 !2138 Document that cropped output files have integer big point dimensions - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2138 !2137 web: Add source links to example images - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2137 !2136 New `space-alist` types `shrink-space` and `semi-shrink-space` - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2136 Countdown: No patches in Countdown at this time. Review: !2146 Various minor fixes - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2146 !2145 running.itely: Improve documentation on quoted arguments - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2145 !2144 Output file name issues - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2144 !2143 NR: Add snippet `arranging-separate-lyrics-on-a-single-line.ly`. - Werner Lemberg https://gitlab.com/lilypond/lilypond/-/merge_requests/2143 New: No patches in New at this time. Waiting: No patches in Waiting at this time. Cheers, Colin
Re: bizarre behaviour of `output-filename`
On Oct 20, 2023, at 06:29, Werner LEMBERG wrote: >> >> Or is this an inheritance thing? Does a `\book` block inherit all >> top-level expressions and convert them to paper variables? > > Some debugging shows it seems to be the latter: All top-level > definitions are available as paper variables within a book's paper > block, together with all paper variables of the top-level paper block: ... > > > > Is this really intentional? https://gitlab.com/lilypond/lilypond/-/issues/5917 https://codereview.appspot.com/567450043 — Dan
Re: Scheme: Using brackets in addition to parentheses
Jean Abou Samra writes: > AFAIK, this is seldom used by Guile coders, though some other Scheme > communities do use this style by convention. > > I wouldn't embark on rewriting lots of code/documentation for this; I > don't think the effort pays off. I don't really like it and I don't think it is our job to promote a different style. -- David Kastrup
Re: Scheme: Using brackets in addition to parentheses
AFAIK, this is seldom used by Guile coders, though some other Scheme communities do use this style by convention. I wouldn't embark on rewriting lots of code/documentation for this; I don't think the effort pays off.
Scheme: Using brackets in addition to parentheses
As I've just discovered, brackets work the same as parentheses in Scheme expressions: ``` #[set-global-staff-size 26] { c' } ``` Guile allows this by default; the read option `square-brackets` is active for compatibility with R6RS. Shall we use and advertise this? Some user Scheme code could probably be made more readable: ``` (let [(foo ...) (bar ...)] ...) (cond [question1 expression1] [question2 expression2] [question3 expression3] [else expression4]) ``` Werner
Re: bizarre behaviour of `output-filename`
> I consider it bizarre that the top-level variable `output-filename` > is only considered in a `\book` block where the paper variable > `output-suffix` is also set, contrary to `output-suffix`. Why is > `output-filename` considered at all? Where in the code is this > read? AFAIK, top-level variables are read with `ly:parser-lookup`, > and I can't find this for `output-filename`. > > Or is this an inheritance thing? Does a `\book` block inherit all > top-level expressions and convert them to paper variables? Some debugging shows it seems to be the latter: All top-level definitions are available as paper variables within a book's paper block, together with all paper variables of the top-level paper block: Executing ``` foo = "FOO" \paper { bar = "BAR" } \book { #(ly:message "paper variable 'foo': ~a\n" (paper-variable $current-book 'foo)) #(ly:message "paper variable 'bar': ~a\n" (paper-variable $current-book 'bar)) { c' } } ``` yields ``` paper variable 'foo': FOO paper variable 'bar': BAR ``` Is this really intentional? Werner
bizarre behaviour of `output-filename`
Consider this input file called `c.ly`: ``` output-filename = "foo" output-suffix = "bar" \book { \paper { output-suffix = "baz" } { c' } } \book { { c' } } \book { { c' } } ``` The created output files are foo-baz.pdf c-bar.pdf c-bar-1.pdf I consider it bizarre that the top-level variable `output-filename` is only considered in a `\book` block where the paper variable `output-suffix` is also set, contrary to `output-suffix`. Why is `output-filename` considered at all? Where in the code is this read? AFAIK, top-level variables are read with `ly:parser-lookup`, and I can't find this for `output-filename`. Or is this an inheritance thing? Does a `\book` block inherit all top-level expressions and convert them to paper variables? Werner