in reply to Re: Re: subroutines and namespace
in thread subroutines and namespace

Actually, you would never want to care where the subroutine's scope is. And, the reason why is that it would violate encapsulation.

The way to think about a subroutine is that it's a self-contained unit of activity. It receives inputs, does stuff, and gives outputs. It should NEVER depend on the caller's scope. It should NEVER depend on anything but that which is within its own personal scope (which should be inviolate and untouchable by caller).

Every single legitimate reason you would want to do what you suggest is negated by a language feature or design change that will make your code more maintainable and easier to work with.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.