lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help creating Scheme functions to automate includes of many sco


From: Nah
Subject: Re: Need help creating Scheme functions to automate includes of many scores in a project
Date: Tue, 26 Jun 2018 08:21:11 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Thanks. That gives me a good starting point. Will it work in a procedure? Something like:
createLessons = #(make-scheme-function ( ... ))

Can I assume the infinite loop to be caused by the ".ly" suffix being the same as the suffix of the main file? If I use ".ily" suffix for all the scores and ".ly" only for the main file, then there is no problem? Or is there something more subtle going on?

Looking around in the Guile manual, I found:
scandir name [select? [entry<?]]

Is scandir specific to Guile? Would it be bad form to use it in Lilypond, say in a file destined for Mutopia? Or is Guile the default for Lilypond?


On 06/25/2018 06:51 PM, David Kastrup wrote:
Nah <address@hidden> writes:

I have a project with 100+ scores, each in their own file. I tried to
create a Scheme function to \include each of them. After searching the
archive, I got the general idea of why my solution isn't
working. However, I didn't find something like a snippet that I could
coax into what I want. I have programming experience in C, Python,
etc., but I'm still pretty clueless with Scheme.

What I want is a function that does something like:
foreach fname #{ \include #fname #}

In Python, I would just read all the filenames in the directory, sort
them, then run the foreach. Can I do something like that in Scheme?
And how do I put the result in a form that will work with \include?




Be aware that this is quite a bad idea if the file itself is in the
directory we are talking about here...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]