Language - (Variable|Field|Scalar)

1 - About

Variables in a computer language are used to store data information. A variable is a piece of storage containing a value.

Variables created by declarations are identified:

  • by a name, such as x,
  • or by expressions, such as x[i] or x.f.

All these variable expressions (x,x[i] or x.f) read the value of a variable, except when they appear on the left-hand side of an assignment, in which case a new value is assigned to the variable.

A variable is considered as the runtime counterpart of a identifier token and therefore are used interchangeably.

Not every value has an address, but every variable does.

Variables are sometimes described as addressable values.

The purpose of variables is to manage:

3 - Declaration

A variable declaration (aka create) creates a variable of a particular type, attaches a name to it, and sets its initial value.

Example:

  • Javascript with they keyword var
var myName;

4 - Properties

Variable have the following properties:

5 - Type

5.1 - Symbolic container

A variable is called a symbolic container (javascript) when the value in this container can vary over time as needed.

6 - Expression

Variable expressions:

  • x,
  • x[i]
  • x.f

7 - Documentation / Reference

code/grammar/variable.txt ยท Last modified: 2018/12/11 20:29 by gerardnico