|
|
|
|
|
by chowells
392 days ago
|
|
No, return exiting the enclosing function scope from a block is the special case that's there to resolve an edge case. Blocks should be nothing special. They're anonymous functions that capture the environment mutably. The only new part is all the special bits added to handle the weird edge cases that they're trying to pretend don't exist. |
|
I think the "Building an intuition" section of my blog post[1] makes a good case for that.
[1] https://maxlap.dev/blog/2022/02/10/what-makes-ruby-blocks-gr...