Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Lukas-Fabian Moser writes: >>> Of course I can do >>> >>> circlefunc = \markup\circle\etc >>> \markup \test \circlefunc "whatever" >> You can? Have you tried? \circlefunc here is quite equivalent to >> \circle . > > Hm, I think I do not understand. With > > test = > #(define-scheme-function

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Of course I can do circlefunc = \markup\circle\etc \markup \test \circlefunc "whatever" You can? Have you tried? \circlefunc here is quite equivalent to \circle . Hm, I think I do not understand. With test = #(define-scheme-function (enclosure content) (markup-function? markup?)

Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Lukas-Fabian Moser writes: > Hi David, > >> test = >> #(define-scheme-function (enclosure content) >>(markup-function? markup?) >>(list enclosure #{ \markup \box #content #})) >> >> \markup \test \markup \circle \with-color #red \etc "whatever" > > Amazing, wonderfully elegant. > > Is

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Hi David, test = #(define-scheme-function (enclosure content) (markup-function? markup?) (list enclosure #{ \markup \box #content #})) \markup \test \markup \circle \with-color #red \etc "whatever" Amazing, wonderfully elegant. Is there a way to avoid the second "\markup" and "\etc"

Re: Making markup functions parametric

2020-07-04 Thread David Kastrup
Urs Liska writes: > In the following markup command definition > > #(define-markup-command (test layout props enclosure content) > (scheme? markup?) >(interpret-markup layout props (markup #:circle content))) > > I would like to make the #:circle parametric, i.e. I want to pass > something

Re: Making markup functions parametric

2020-07-04 Thread Urs Liska
Hi Lukas, Am Samstag, den 04.07.2020, 10:22 +0200 schrieb Lukas-Fabian Moser: > Hi Urs, > > > I have tried various things, but I don't seem to understand how > > that > > primitive-eval actually works here. Your solution does only work > > when > > the input is a simple markup (string), not when

Re: Making markup functions parametric

2020-07-04 Thread Lukas-Fabian Moser
Hi Urs, I have tried various things, but I don't seem to understand how that primitive-eval actually works here. Your solution does only work when the input is a simple markup (string), not when it is wrapped in other markup commands. It seems to work quite robustly if you draw the given

Re: Making markup functions parametric

2020-07-04 Thread Urs Liska
Am Samstag, den 04.07.2020, 05:28 +0200 schrieb Urs Liska: > > Am 3. Juli 2020 23:33:42 MESZ schrieb Lukas-Fabian Moser > : > > > #(define (get-scheme-markup-function func) > > >(string->symbol > > > (string-append "make-" > > >(symbol->string func) > > >

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Am 3. Juli 2020 23:33:42 MESZ schrieb Lukas-Fabian Moser : > >> #(define (get-scheme-markup-function func) >>    (string->symbol >>     (string-append "make-" >>    (symbol->string func) >>    "-markup"))) > >... which should be replaced by > >#(define

Re: Making markup functions parametric

2020-07-03 Thread Lukas-Fabian Moser
#(define (get-scheme-markup-function func)    (string->symbol     (string-append "make-"    (symbol->string func)    "-markup"))) ... which should be replaced by #(define (get-scheme-markup-function func)    (symbol-append 'make- func '-markup)) Sorry, I had

Re: Making markup functions parametric

2020-07-03 Thread Lukas-Fabian Moser
Hi Urs, Thanks a lot. That's exactly the kind of procedure I can store and apply: \version "2.20.0" #(define-markup-command (dyna layout props func content)(symbol? markup?) (let* ((funcs `((box . ,make-box-markup) (circle . ,make-circle-markup

Re: Making markup functions parametric

2020-07-03 Thread Aaron Hill
On 2020-07-03 1:07 pm, Urs Liska wrote: But I'd rather do something like (markup (assq-ref enclosures enclosure) "CC") markup is a macro, and macros appear to have unique rules of evaluation. The following approach defers the macro expansion: \version "2.20.0"

Re: Making markup functions parametric

2020-07-03 Thread Ralf Mattes
Am Freitag, 03. Juli 2020 22:07 CEST, Urs Liska schrieb: > > Syntacilally? That would be a scheme keyword. > > So that would be difficult to inject from a variable/argument, isn't > it? No, why? You can of course store a keyword in a variable and/or pass it as an argument. > I can of course

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Hi Robin, Am Freitag, den 03.07.2020, 22:11 +0200 schrieb Robin Bannister: > Urs Liska wrote: > > > Unfortunately I don't really have an idea what "#:circle" actually > > *is*, so I have no clue about getting where I need to. > > I think it's a sort of macro thingy, trying to be easy to be

Re: Making markup functions parametric

2020-07-03 Thread Robin Bannister
Urs Liska wrote: Unfortunately I don't really have an idea what "#:circle" actually *is*, so I have no clue about getting where I need to. I think it's a sort of macro thingy, trying to be easy to be used. Look at 'Known issues and warnings' at the bottom of

Re: Making markup functions parametric

2020-07-03 Thread Urs Liska
Am Freitag, den 03.07.2020, 21:58 +0200 schrieb Ralf Mattes: > > Am Freitag, 03. Juli 2020 21:52 CEST, Urs Liska < > li...@openlilylib.org> schrieb: > > > Unfortunately I don't really have an idea what "#:circle" actually > > *is*, so I have no clue about getting where I need to. > >

Re: Making markup functions parametric

2020-07-03 Thread Ralf Mattes
Am Freitag, 03. Juli 2020 21:52 CEST, Urs Liska schrieb: > Unfortunately I don't really have an idea what "#:circle" actually > *is*, so I have no clue about getting where I need to. Syntacilally? That would be a scheme keyword. Cheers, RalfD > BestUrs > > -- Ralf Mattes Hochschule für