Content deleted Content added
added a word |
|||
Line 2:
In [[computer programming]], a '''variable''' is an [[identifier]] (usually a letter, word, or phrase) that is linked to a [[value (computer science)|value]] stored in the system's [[Computer data storage|memory]] or an [[Expression (programming)|expression]] that can be evaluated. For instance, a variable might be called "<code>total_count</code>" and contain a number.
In [[imperative programming|imperative]] [[programming language]]s, values can generally be [[Dereference|accessed]] or [[Assignment (computer science)|changed]] at any time. However, in [[Pure function|pure]] [[functional programming|functional]] and [[logic programming|logic language]]s, variables are [[Free variables and bound variables|bound]] to expressions and keep a single value during their+
wrong entire [[Scope (programming)|lifetime]] due to the requirements of [[referential transparency (computer science)|referential transparency]]. In imperative languages, the same behavior is exhibited by [[constant (programming)|constant]]s, which are typically contrasted with normal variables. Depending on the [[type system]] of a programming language, variables may only be able to store a specified [[datatype]] (e.g. [[Integer (computer science)|integer]] or [[string (computer science)|string]]). Alternatively a datatype may be associated only with the current value, allowing a single variable to store anything supported by the programming language.
|