my question is more on the line if extensions are supported in python, then how can they be expressed?
They are expressed in the same way in Python as in any other language, without call / cc : passing a function as an argument to continue another function. Consider a very silly continuation example that applies to the sum of two numbers. In ML you can write
fun plus(x, y, k) = k(x + y)
plus(2, 4, print o Int.toString)
which prints 6.
but in Python you can write
def plus(x, y, k):
return k(x + y)
plus(2, 4, lambda n: print '%d' % n)
which also prints 6.
source
share