lilypond-user
[Top][All Lists]
Advanced

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

Re: Bug with transpose in functions


From: Wols Lists
Subject: Re: Bug with transpose in functions
Date: Fri, 12 Jul 2019 20:09:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0

On 12/07/19 19:04, Werner LEMBERG wrote:
> 
>> Functions like transpose act destructively on their argument, so you
>> need a copy or the original will get changed.  [...]
> 
> How can Joe User find out whether a function is acting destructively?
> 
Computer pedant here :-)

Functions do not have side effects, and for any given input they always
return the same output. So if this is a PROPER function, it cannot act
destructively :-)

Obviously it isn't, so it's technically a subroutine that returns a
value. Dunno how you tell the difference, but that's why you get
computer languages where all variables are "write once" - everything is
based on proper functions.

Maybe the documentation should make a point of saying whether functions
are "proper" or "improper". :-)

Cheers,
Wol




reply via email to

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