Ring/Lessons/Variables

Variables
To create a new variable, you just need to determine the variable name & value. The value will determine the variable type and you can change the value to switch between the types using the same variable name.

Syntax:

.. tip:: The operator '=' is used here as an Assignment operator and the same operator can be used in conditions, but for testing equality of expressions.

.. note:: The Variable will contains the real value (not a reference). This means that once you change the variable value, the old value will be removed from memory (even if the variable contains a list or object).

Dynamic Typing
Ring is a dynamic programming language that uses `Dynamic Typing `_.

Deep Copy
We can use the assignment operator '=' to copy variables. We can do that to copy values like strings & numbers. Also, we can copy complete lists & objects. The assignment operator will do a complete duplication for us. This operation called `Deep Copy `_

Weakly Typed
Ring is a `weakly typed language `_, this means that the language can automatically convert between data types (like string & numbers) when that conversion make sense.

Rules:

.. note::

The same operator '+' can be used as an arithmetic operator or for string concatenation.

Example: