Hello Justin,

"What is the difference between a (constant/immutable) value and the
result of calling a side-effect free function that returns the same?"

A const value can't be changed from the current context but could be changed via another alias or inside a non side effect free function or via one of those in another thread.

An immutable value can't change, end of story.

The value a side-effect free function returns can change as soon as anything changes, a local var (via nested functions) global var or anything addressable through them.

The function most closely resembles the const var.


--
... <IXOYE><



Reply via email to