可能是玩functional太多了,当我写java和python都会用Lambda
Python 3
def increase (n): return lambda x: x + n
vals = increase([1])
print(vals(2))
然后在lambda都能用filter,map和reduce
可能是玩functional太多了,当我写java和python都会用Lambda
Python 3
def increase (n): return lambda x: x + n
vals = increase([1])
print(vals(2))
然后在lambda都能用filter,map和reduce