> Now, even if you can call b without parens, it still has to redo the expensive calculation every time you access it (because a might have changed... even if it hasn't).
That's true in most programming languages, but not in languages that distinguish side-effect free code. (Such a language implementation might still rerun a pure function because it doesn't include a way of "remembering" that a function has been called with particular arguments before, but that's an implementation detail.)
That's true in most programming languages, but not in languages that distinguish side-effect free code. (Such a language implementation might still rerun a pure function because it doesn't include a way of "remembering" that a function has been called with particular arguments before, but that's an implementation detail.)