[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: overfull lines in IR
From: |
Thomas Morley |
Subject: |
Re: overfull lines in IR |
Date: |
Tue, 23 Feb 2021 12:11:10 +0100 |
Am Mo., 22. Feb. 2021 um 13:24 Uhr schrieb Werner LEMBERG <wl@gnu.org>:
>
> >> Right now, some overlong lines are auto-generated in the Internals
> >> Reference. [...]
> >
> > It seems to me that during the creation of the documentation,
> > expansion of the property value should be prevented.
>
> Continuing my monologue...
>
> I guess that if we have
>
> foo = #bar
>
> in LilyPond then `bar` gets unavoidably expanded. This makes it
> impossible to document it properly in an automated way.
>
> I'm not a Scheme guru but I guess we would need a function or macro to
> prevent expansion for stuff that gets auto-documented. For example, I
> could imagine that we have
>
> foo = #(auto-document 'bar)
>
> (or whatever syntax would be appropriate) instead; the right side
> expands `bar` for normal usage but becomes the string `#bar` while
> running LilyPond's auto-documentation stuff.
>
> Would this be feasible? It would uglify source code files but
> enormously improve the IR.
>
> Are there better ideas?
>
>
> Werner
>
Hi Werner,
> Continuing my monologue...
let me add a few thoughts...
As user I'd want to find the default values for grob- and
context-properties in IR.
Internally they are usually specified in define-grobs.scm and
engraver-init.ly, afaik.
In my view one can destinct between static values like: booleans,
numbers, quoted lists, etc and procedures, unpure-pure-containers,
etc.
###
For those static ones I have the strong opinion, we should always
print them expanded and literally, even for a longer list. Thus
• Set translator property ottavationMarkups to:
'((4 . "29")
(3 . "22")
(2 . "15")
(1 . "8")
(-1 . "8")
(-2 . "15")
(-3 . "22")
(-4 . "29"))
is fine.
###
For procedures, we probably could print only the name. Alas, it would
be misleading for autoAccidentals:
Your example
• Set translator property autoAccidentals to:
'(Staff #<procedure #f (context pitch barnum measurepos)>
#<procedure neo-modern-accidental-rule (context pitch
barnum measurepos)>)
would become:
(Staff #f neo-modern-accidental-rule)
Then I'd expect every user to ask: wtf is #f here...?
Maybe we could replace #f with `anonymus procedure' or the like, but
I'm not convinced...
###
hash-tables and unpure-pure-containers are even worse.
Things like:
• Set translator property predefinedDiagramTable to #<hash-table 0/113>.
or
vertical-skylines (pair of skylines):
#<unpure-pure-container #<primitive-procedure
ly:grob::vertical-skylines-from-stencil> #<primitive-procedure
ly:grob::pure-simple-vertical-skylines-from-extents> >
are not very helpful for a user. Though, I've not a good idea how to
improve here.
Cheers,
Harm