NeturalMath Language Definition and Syntax

Using Variables

Variables in NeturalMath are designed to be as easy to use as possible. All variables in NeturalMath are dynamically typed, which means that the system will try to determine how a variable is being used, and what kind of data it should represent before it is called upon. Another aspect of variables in NeturalMath that differs from many other programming languages is that variables do not have to be assigned a fixed value. Instead, they may be assigned an expression which is evaluated later in the application.

Declaring Variables

Declaring a new variable in NeturalMath is as simple as introducing the variable name into an equation. The variable may be included as part of an assignment, or as part of an expression. Unlike most programming languages, NeturalMath does not require that a variable be defined before it is used. If a variable is used within an expression without having first been assigned to a value, it is known as an implicit variable.
x = 10        // Assigning a variable to a value of 10
y = 3 + x     // Assigning a variable to an expression based on x (declared above)
z = a + b     // Declaring the variable z and assigning to an expression containing the implicit variables a and b

Variables and Scope

See Also

This section is not complete

Last edited Oct 16, 2010 at 3:05 PM by zanethorn, version 2


No comments yet.