<s>
In	O
programming	O
languages	O
,	O
name	B-Application
resolution	I-Application
is	O
the	O
resolution	O
of	O
the	O
tokens	O
within	O
program	O
expressions	O
to	O
the	O
intended	O
program	O
components	O
.	O
</s>
<s>
In	O
that	O
context	O
,	O
name	B-Application
resolution	I-Application
refers	O
to	O
the	O
association	O
of	O
those	O
not-necessarily-unique	O
names	O
with	O
the	O
intended	O
program	O
entities	O
.	O
</s>
<s>
For	O
example	O
,	O
name	B-Application
resolution	I-Application
in	O
assembly	B-Language
language	I-Language
usually	O
involves	O
only	O
a	O
single	O
simple	O
table	B-Application
lookup	I-Application
,	O
while	O
name	B-Application
resolution	I-Application
in	O
C++	B-Language
is	O
extremely	O
complicated	O
as	O
it	O
involves	O
:	O
</s>
<s>
scopes	O
,	O
which	O
make	O
it	O
possible	O
for	O
an	O
identifier	O
to	O
have	O
different	O
meanings	O
at	O
different	O
scope	B-Language
levels	O
,	O
and	O
which	O
involves	O
various	O
scope	B-Language
overriding	O
and	O
hiding	O
rules	O
.	O
</s>
<s>
At	O
the	O
most	O
basic	O
level	O
name	B-Application
resolution	I-Application
usually	O
attempts	O
to	O
find	O
the	O
binding	O
in	O
the	O
smallest	O
enclosing	O
scope	B-Language
,	O
so	O
that	O
for	O
example	O
local	O
variables	O
supersede	O
global	O
variables	O
;	O
this	O
is	O
called	O
shadowing	B-Language
.	O
</s>
<s>
overloading	B-Language
,	O
which	O
makes	O
it	O
possible	O
for	O
an	O
identifier	O
to	O
have	O
different	O
meanings	O
depending	O
on	O
how	O
it	O
is	O
used	O
,	O
even	O
in	O
a	O
single	O
namespace	O
or	O
scope	B-Language
;	O
</s>
<s>
accessibility	O
,	O
which	O
determines	O
whether	O
identifiers	O
from	O
an	O
otherwise	O
visible	O
scope	B-Language
are	O
actually	O
accessible	O
and	O
participate	O
in	O
the	O
name	B-Application
resolution	I-Application
process	O
.	O
</s>
<s>
In	O
programming	O
languages	O
,	O
name	B-Application
resolution	I-Application
can	O
be	O
performed	O
either	O
at	O
compile	B-Application
time	I-Application
or	O
at	B-Library
runtime	I-Library
.	O
</s>
<s>
The	O
former	O
is	O
called	O
static	B-Application
name	I-Application
resolution	I-Application
,	O
the	O
latter	O
is	O
called	O
dynamic	B-Application
name	I-Application
resolution	I-Application
.	O
</s>
<s>
A	O
somewhat	O
common	O
misconception	O
is	O
that	O
dynamic	O
typing	O
implies	O
dynamic	B-Application
name	I-Application
resolution	I-Application
.	O
</s>
<s>
For	O
example	O
,	O
Erlang	B-Operating_System
is	O
dynamically	O
typed	O
but	O
has	O
static	B-Application
name	I-Application
resolution	I-Application
.	O
</s>
<s>
However	O
,	O
static	O
typing	O
does	O
imply	O
static	B-Application
name	I-Application
resolution	I-Application
.	O
</s>
<s>
Static	B-Application
name	I-Application
resolution	I-Application
catches	O
,	O
at	O
compile	B-Application
time	I-Application
,	O
use	O
of	O
variables	O
that	O
are	O
not	O
in	O
scope	B-Language
;	O
preventing	O
programmer	O
errors	O
.	O
</s>
<s>
Languages	O
with	O
dynamic	O
scope	B-Language
resolution	O
sacrifice	O
this	O
safety	O
for	O
more	O
flexibility	O
;	O
they	O
can	O
typically	O
set	O
and	O
get	O
variables	O
in	O
the	O
same	O
scope	B-Language
at	B-Library
runtime	I-Library
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
Python	B-Language
interactive	O
REPL	B-Application
:	O
</s>
<s>
However	O
,	O
relying	O
on	O
dynamic	B-Application
name	I-Application
resolution	I-Application
in	O
code	O
is	O
discouraged	O
by	O
the	O
Python	B-Language
community	O
.	O
</s>
<s>
The	O
feature	O
also	O
may	O
be	O
removed	O
in	O
a	O
later	O
version	O
of	O
Python	B-Language
.	O
</s>
<s>
Examples	O
of	O
languages	O
that	O
use	O
static	B-Application
name	I-Application
resolution	I-Application
include	O
C	B-Language
,	O
C++	B-Language
,	O
E	B-Language
,	O
Erlang	B-Operating_System
,	O
Haskell	B-Language
,	O
Java	B-Language
,	O
Pascal	B-Application
,	O
Scheme	B-Language
,	O
and	O
Smalltalk	B-Application
.	O
</s>
<s>
Examples	O
of	O
languages	O
that	O
use	O
dynamic	B-Application
name	I-Application
resolution	I-Application
include	O
some	O
Lisp	B-Language
dialects	O
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Python	B-Language
,	O
REBOL	B-Application
,	O
and	O
Tcl	B-Operating_System
.	O
</s>
<s>
At	O
the	O
level	O
of	O
variables	O
(	O
rather	O
than	O
names	O
)	O
,	O
this	O
is	O
known	O
as	O
variable	B-Language
shadowing	I-Language
.	O
</s>
<s>
The	O
outer	O
variable	O
X	O
is	O
said	O
to	O
be	O
shadowed	B-Language
by	O
the	O
inner	O
variable	O
X	O
 '	O
.	O
</s>
<s>
Name	O
masking	O
can	O
cause	O
complications	O
in	O
function	B-Language
overloading	I-Language
,	O
due	O
to	O
overloading	B-Language
not	O
happening	O
across	O
scopes	O
in	O
some	O
languages	O
,	O
notably	O
C++	B-Language
,	O
thus	O
requiring	O
all	O
overloaded	B-Language
functions	I-Language
to	O
be	O
redeclared	O
or	O
explicitly	O
imported	O
into	O
a	O
given	O
namespace	O
.	O
</s>
<s>
In	O
programming	O
languages	O
with	O
lexical	O
scoping	B-Language
that	O
do	O
not	O
reflect	B-Language
over	O
variable	O
names	O
,	O
α-conversion	O
(	O
or	O
α-renaming	O
)	O
can	O
be	O
used	O
to	O
make	O
name	B-Application
resolution	I-Application
easy	O
by	O
finding	O
a	O
substitution	O
that	O
makes	O
sure	O
that	O
no	O
variable	O
name	O
masks	B-Language
another	O
name	O
in	O
a	O
containing	O
scope	B-Language
.	O
</s>
<s>
Alpha-renaming	O
can	O
make	O
static	O
code	O
analysis	O
easier	O
since	O
only	O
the	O
alpha	O
renamer	O
needs	O
to	O
understand	O
the	O
language	O
's	O
scoping	B-Language
rules	I-Language
.	O
</s>
<s>
within	O
the	O
constructor	O
,	O
the	O
class	B-Application
variables	I-Application
and	O
are	O
shadowed	B-Language
by	O
local	O
variables	O
of	O
the	O
same	O
name	O
.	O
</s>
