Is there a way to change the closure of a python function?

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Sep 29 02:13:01 EDT 2016


Paul Moore wrote:
> What "allows side effects" in languages like Haskell is the fact that the
> runtime behaviour of the language is not defined as "calculating the value of
> the main function" but rather as "making the process that the main functon
> defines as an abstract monad actually happen".

That's an interesting way of looking at it. To put it
another way, what matters isn't just the final result,
but *how* the final result is arrived at.

In the case where the main function never returns,
the "final result" doesn't even exist, and all you
have left is the process.

Philosophical question: Is a function that never
returns actually a function?

-- 
Greg



More information about the Python-list mailing list