27 ms·
Shadowing is when you have two separate variables with the same identifier. It is beyond obvious that all the x's refer to the same variable in dilap's example.
by hope-striker 7y ago
Shadowing is when you have two separate variables with the same identifier. It is beyond obvious that all the x's refer to the same variable in dilap's example. Contrast that with an actual example of shadowing[0], in which it is clear that the same identifier is being used to refer to two different variables.
[0]: https://en.wikipedia.org/wiki/Variable_shadowing#Python https://en.wikipedia.org/wiki/Variable_shadowing#Python
- joshuamorton 7y agoI'm using shadowing in the rust sense, not the python sense.
- hope-striker 7y agoThey are the exact same sense! The exact same idea of shadowing is also present in, for example, sentences in first order logic.