Monday, November 9, 2015

Easy way out of referencing dilemmas

So, this business about nested subprograms using non-local variables does bring up some fascinating implementation points. I honestly have never given them much thought. Why? BECAUSE ONLY A NUT JOB WOULD REFERENCE NON-LOCAL VARIABLES IN A NESTED ROUTINE.

Ok, that's not entirely true. Lambda expressions are effectively nested routines and they do need to preserve context beyond the routine in which they are defined, but, that's done with closures, not a bunch of convoluted chain rules to define the reference environment.

Yes, language designers need to work this stuff out, but programmers don't. Programmers can just stick to good coding practices and not worry about it.

No comments:

Post a Comment