i realize this is an old, outstanding issue, but the reference page page at
really ought to state, even in small print, that constrain() is a macro, and has Side Effects. i know it's not a simple thing to explain to relatively inexperienced programmers (i gave up trying to formulate a simple example for this post without a lot of digression) but it's fairly serious.
it would be better if constrain(), and any other macros, were recoded as overloaded functions.
i tried to search the Reference to find reference to anything else implemented as a macro (eg. toupper()) but failed.