Given a lambda with a captured local variable,
- Add a new parameter to the lambda
- Inside the lambda, replace uses of the local with uses of the new parameter
- Where the lambda is called, pass in the local.
Loading Gist 9bb6b3066f60fb7aaa7ad1f39af3cd1d...
I believe this is a refactoring: I believe that this transformation has no effect on the behavior of the code. But I'm not completely certain.
This operation is not allowed if the value of the local is changed inside the lambda.
This is almost the same operation as Introduce Parameter.
1 comment:
Jim did this a lot in his talk:
https://vimeo.com/45140590
minute: 17
He called it: the tennent correspondence principle
Post a Comment