| def logged[K, T](f: (K) => T)(arg: K): T = { | |
| // log arg | |
| f(arg) | |
| // log arg | |
| } | |
| def someFunction(value: Integer): Integer = { | |
| Integer.valueOf(value * 2) | |
| } | |
| def theExecution() { | |
| // here we go: the 'execution' object has exactly the same type as 'someFunction' | |
| val execution = logged(someFunction) _ | |
| execution(2) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment