is there a way to define or call a function such that it runs (or is defined to be in) the same context as the caller (e.g. uses the exact same local space and global space as the caller).
i do understand that it can be argued that this would be "side effect hell" because such a function could change anything. my need involves a chunk of code that is repeated many time in the same function. this chunk of code does assign to about a dozen different variables. it would be nice to encapsulate it somewhere so it can simply be called with 1 line instead of having 20 lines of code everywhere it is needed.
i do understand that it can be argued that this would be "side effect hell" because such a function could change anything. my need involves a chunk of code that is repeated many time in the same function. this chunk of code does assign to about a dozen different variables. it would be nice to encapsulate it somewhere so it can simply be called with 1 line instead of having 20 lines of code everywhere it is needed.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.