Gosu variables
A Gosu variable is a storage container for a certain type of data. As you create and assign a Gosu variable, you need to consider the type of the variable as well as its value.
Strong typing of variables
If you specify a type for a variable in its declaration in Gosu code, Gosu thereafter considers the variable to be strongly typed. Any attempt to assign an incompatible value to the variable generates a type-mismatch error. Similarly, if you set a value for a variable in the variable declaration, but do not specify the variable type, Gosu strongly types the variable to the type of the provided initial value.
The only way to declare a variable without a strong type is to initialize it with a null
value without a specifying a type. However, even if you do not assign a type to a variable in its declaration,
the variable takes on the type of the first value assigned to it.
Character set available for variable names
- A letter
$_
- A letter
- A digit
$_
var русский_язык = 1.0var Español = 2.0var 日本語_$ = 3.0print(русскийязык * Español * 日本語$)
