This behaviour is kind-of warned about in the docs:
....although I must admit I didn't know this before your post, and I only
stumbled on that doc entry because I happened to be doing something with
functions recently too. One to remember!
Bill (the other P)