[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: srfi-1 not available in \layout
From: |
Thomas Morley |
Subject: |
Re: srfi-1 not available in \layout |
Date: |
Fri, 8 May 2015 22:55:59 +0200 |
Hi Jan-Peter,
2015-05-08 9:37 GMT+02:00 Jan-Peter Voigt <address@hidden>:
> Hi Harm,
>
> I think, its a matter of scope. You have to "import" srfi via use-modules,
> but you can't do that inside \layout{} (IIUC).
> You can use a self-defined wrapper-command, to access the needed functions:
>
> \version "2.19.18"
No need to do this, since srfi-1 is included in ly-files per default
> #(use-modules (srfi srfi-1))
> #(define-public (disp-append-map a b)(display (append-map a b)))
> \layout { #(disp-append-map identity '((1) (2))) }
> { c''1 }
Even the following works
\version "2.19.18"
#(define append-map append-map)
\layout { #(display (append-map identity '((1) (2)))) }
{ c''1 }
>
> HTH
> Cheers,
> Jan-Peter
>
> Am 08.05.2015 um 02:49 schrieb Thomas Morley:
>>
>> \version "2.19.18"
>> \layout { #(display (append-map identity '((1) (2)))) }
>> { c''1 }
To give more context: I devolped a function to answer a user-question.
In the end it should be generally applied, so I inserted it in
\layout, causing the error.
In my naivity I expected the function to work in layout as it does
applied directly to some music and was surprised of the missing srfi-1
Ofcourse there are several ways to workaround. I used
(apply append (map ...
Though the main point is, one should be able to put functions into
\layout without bothering which module is included where in .ly-files.
Cheers,
Harm