[ create a new paste ] login | about

Link: http://codepad.org/Mwa42YlL    [ raw code | fork ]

Python, pasted on Dec 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ python
Python 2.7.5 (default, Sep  2 2013, 20:02:46) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from funcy import compose
>>> def add(a, b):
...     return a + b
... 
>>> def div2(x):
...     return x / 2
... 
>>> f = compose(div2, add)
>>> f(5, 1)
3
>>> 


Create a new paste based on this one


Comments: