Three main reasons I can think of:
- Parent Scope Access
- Reduction of names defined in higher scopes
Parent Scope Access: Inline function definitions allow the inline code to have access to variables defined in parent scopes. This can be very useful for many things and can reduce the amount or complexity of code if done properly.
If you put the code in a function defined outside of this scope and then call the code, you would then have to pass any parent state that it wanted to access to the function.
Privacy: Code inside an inline anonymous definition is more private and cannot be called by other code.