Wols Lists <antli...@youngman.org.uk> writes: > 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 :-)
Nobody said it was. In computer parlese, functions of the kind you describe are commonly called pure functions. Nobody said that music functions were of that kind. > 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". :-) I was pretty sure that I wrote some treatise on that but a superficial search did not turn it up, and if I do not manage to find some treatise with a superficial search, it would be too much to expect for a new user. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user