n | def help_call(f, x): | n | def foo(s, f): |
| if callable(f): | | if callable(f): |
n | return f(x) | n | return f(s) |
| else: | | else: |
| return f | | return f |
| | | |
| | | |
| def ADD(f, g): | | def ADD(f, g): |
n | return lambda x: help_call(f, x) + help_call(g, x) | n | return lambda s: foo(s, f) + foo(s, g) |
| | | |
| | | |
| def SUB(f, g): | | def SUB(f, g): |
n | return lambda x: help_call(f, x) - help_call(g, x) | n | return lambda s: foo(s, f) - foo(s, g) |
| | | |
| | | |
| def MUL(f, g): | | def MUL(f, g): |
n | return lambda x: help_call(f, x) * help_call(g, x) | n | return lambda s: foo(s, f) * foo(s, g) |
| | | |
| | | |
| def DIV(f, g): | | def DIV(f, g): |
t | return lambda x: help_call(f, x) / help_call(g, x) | t | return lambda s: foo(s, f) / foo(s, g) |
| | | |