Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # It'd be great if the following:
- map({|x| x**2}, [1,2,3])
- # would compile to the following:
- def __anon_func__(x):
- return x**2
- map(__anon_func__, [1,2,3])
- del __anon_func__
- # I know it looks Ruby-ish, but it would look
- # so much better. It would also let programmers
- # write anonymous functions with 2+ lines, which
- # would be awesome.
- #
- # Alternatives to {|x| x**2} could be:
- #
- # (\x -> x**2)
- # ((x) -> x**2)
- # ((x) => x**2)
- #
- # I think I just miss a good lambda support
- # on Python... :(
Advertisement
Add Comment
Please, Sign In to add comment