On 3/24/2014 8:28 PM, Chris Angelico wrote:
Pure functional programming, from what I understand, doesn't *have* variables other than function arguments.
function *parameters*, if in the 'variable = name' camp
So the way to implement "x = 1" is to call a subfunction
with a parameter named 'x'
with an argument of 1
Funny, I was just thinking about that last night. I really learned it when trying to translate python code to the scheme dialect racket.
import math as m s = m.sqrt(2) a = m.sin(s) + m.cos(s) del s # to be exactly equivalent to the below, but not needed b = (lambda x: m.sin(x) + m.cos(x))(m.sqrt(2)) print(a,b) >>> 1.14370964075811 1.14370964075811 -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list