Name resolution (programming languages): Difference between revisions

Content deleted Content added
dedent code examples
m Static versus dynamic: grammar/flow
Line 15:
In [[programming language]]s, name resolution can be performed either at [[compile time]] or at [[Run time (program lifecycle phase)|runtime]]. The former is called '''static name resolution''', the latter is called '''dynamic name resolution'''.
 
A somewhat common misconception is that [[dynamic typing]] implies dynamic name resolution. However, static typing does imply static name resolution. For example, [[Erlang (programming language)|Erlang]] is dynamically typed but has static name resolution. However, static typing does imply static name resolution.
 
Static name resolution catches, at compile time, use of variables that are not in scope; preventing programmer errors. Languages with dynamic scope resolution sacrifice this safety for more flexibility; they can typically set and get variables in the same scope at runtime.