I am sorry, but I don't think it's possible. fork or Thread.new may pass some values to the block that should be referenced by its own numbered parameters.
We have no way to distinguish whether it's possible to inherit outer ones or not.
I am sorry, but I don't think it's possible. fork or Thread.new may pass some values to the block that should be referenced by its own numbered parameters.
We have no way to distinguish whether it's possible to inherit outer ones or not.
This is entirely tongue-in-cheek, but we could count the number of underscores…
[1,2,3].eachdofoo{puts(__1)}end
And if the it proposal is ever accepted, we could count the number of is: