On Sun, Feb 16, 2020 at 10:40 PM David Kastrup <[email protected]> wrote: > >> > In this commit, extra support for the case where command-and-args is > >> empty was added, ie. > >> > >> That characterisation is completely wrong. The support is not for the > >> cases "where command-and-args is empty" but rather where > >> command-and-args is not a list but a single symbol. Just like > >> > >> (define symbol value) > >> and > >> (define (symbol arg1 arg2) body...) > >> > > > > I'm trying to get the markup macros working with GUILE 2.x compilation, > > which means that all calls to module-define! have to go. > > > > As a prelude to that, I'm trying to understand what this code is trying > to > > do. > > > > I don't think supporting > > > > (define-markup-command sym1 sym2) > > > > is very useful, but if you really want to have this, it should be > > documented and tested. > > It is not as much (define-markup-command sym1 sym2) rather than > > (define-markup-command sym1 (markup-lambda (...)) > > where the markup-lambda expression is independently created. > > This was supposed to be the implementation used in parser.yy for things > like > > \markup big-red = \markup \big \with-color #red \etc > > where defined name and definition are separate entities. It turned out > that calling macros from C did not work well, so I instead I had to call > the non-macro internals. It still made no sense scrapping that > functionality since it is similarly useful from Scheme where it looks > decidedly more natural than using the internals. > > It would appear I am not alone in considering that useful: > > git blame d03a3486639de982cfb6c6c315d76039bc5a0ac5 ly/markup-init.ly > > shows Nicolas Sceaux already implementing this ability independently in > 2006. >
I'll take the blame for not having reviewed it carefully enough. This functionality was undocumented and untested in 2006, and I bet that I didn't understand it back then. I had a hard time keeping up with Nicolas' mastery of Scheme macros. I propose that if we keep it, it gets commented, documented and tested. Could you propose change to do so? -- Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
