Content deleted Content added
No edit summary Tags: Reverted Visual edit Mobile edit Mobile web edit |
Jerryobject (talk | contribs) m WP:LINKs: update-standardizes, needless WP:PIPE > WP:NOPIPE. Cut needless carriage return in paragraph. |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1:
{{Short description|Matching of lexical tokens to the components of a computer program}}
{{see also|Name resolution (computer systems)}}
In [[programming language]]s, '''name resolution''' is the resolution of the [[lexical analysis|token]]s within program expressions to the intended program components.
Line 29 ⟶ 30:
</syntaxhighlight>
However, relying on dynamic name resolution in code is discouraged by the Python community.<ref>{{cite web|url=http://mail.python.org/pipermail/python-ideas/2009-May/004582.html|title=<nowiki>[</nowiki>Python-Ideas<nowiki>]</nowiki> str.format utility function|date=9 May 2009|
Examples of languages that use static name resolution include [[C (programming language)|C]], [[C++]], [[E (programming language)|E]], [[Erlang (programming language)|Erlang]], [[
==Name masking==
'''Masking''' occurs when the same identifier is used
# I' has the same name as I
# I' is defined in a scope which is a subset of the scope of I
Line 57 ⟶ 58:
==Alpha renaming to make name resolution trivial==
In programming languages with [[lexical scoping]] that do not [[
For example, in this code:
Line 76:
}
</syntaxhighlight>
within the {{mono|Point}} constructor, the [[
<syntaxhighlight lang="cpp">
class Point {
|