Talk:First-class function: Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
Ruud Koot (talk | contribs)
Does Haskell allow functions as keys in a map?: show that mutable variables are handled correctly
Line 301:
<source lang="python">
>>> def main():
... a = 10
... b = 10
... f = (lambda ls: map(lambda x: a * x + b, ls))
... a = 3
... b = 1
... return (lambda ls: map(lambda x: a * x + b, ls))f
...
>>> main()([1,2,3,4,5])