On Thursday, 5 January 2023 at 16:41:32 UTC, Adam D Ruppe wrote:
On Thursday, 5 January 2023 at 16:38:49 UTC, Vijay Nayar wrote:
Does that class inherit the scope of the function it is inside, similar to how an inner class does with an outer class?

yup. They can see the local variables from the function.

Glad to learn that. Having worked many years in the Java world, where basically "class" and "scope" are nearly synonymous, I just assumed that classes could only get the scope of other classes, it never occurred to me that it could get a scope from a function.

Thanks for the explanation!

Reply via email to