[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automated processing of multiple books
From: |
David Kastrup |
Subject: |
Re: Automated processing of multiple books |
Date: |
Wed, 04 Nov 2015 21:48:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Simon Albrecht <address@hidden> writes:
> On 04.11.2015 20:36, David Kastrup wrote:
>> Simon Albrecht <address@hidden> writes:
>>
>>> On 04.11.2015 19:24, David Kastrup wrote:
>>>> Simon Albrecht <address@hidden> writes:
>>>>
>>>>> This compiles fine inasmuch as the output is just as intended, but it
>>>>> does sport a:
>>>>>
>>>>> <0>"/home/simon/lilypond/tests/wrap-multiple-books.ly:17:1: error: bad
>>>>> expression type
>>>>>
>>>>> \printParts one.two"
>>>>>
>>>>> Is this worth a bug report about this error appearing too easily?
>>>> No. You use map instead of for-each,
>>> How would I use for-each here? I’m not familiar with that.
>> for-each has exactly the same arguments as map but does not return a
>> value.
>>
>>>> you use define-scheme-function instead of define-void-function.
>>> Ah, I see. I wouldn’t have thought that a function which basically
>>> runs print-book-with-default would classify as a void function.
>> What do you consider "void" then?
>
> Basically, my notion of a ‘void function’ comes from the LilyPond
> documentation, and I’d phrase it as ‘a function which is not executed
> for its output (or return value), but for side-effects’, such as
> variable definitions &c.
> And I thought print-book-with-default was executed in order to output
> a ‘book’.
Which is not a return value. Consequently a side-effect.
> Is it closer to the truth to say that it only passes the information
> on, instead of ‘returning’ or ‘outputting’ it?
Any effect apart from returning a value is a side-effect. This includes
writing to files and variables out of a function's scope. It also
includes reading from files if that read causes any change like an
advancement of a file pointer.
--
David Kastrup