Coding Qubics in QL

Variables

Types of Variables

my_int    = -3;
my_double = 3.14;
my_string = 'Qubic Lite';
my_json   = {'name': 'anton', 'age': 48};
my_list   = [3, 'hello world', -2.2];

Booleans

Booleans in QL do not actually exist as a seperate type. For conditions and logical operations, every value is threated as true, except for: 0 and 0.0 (double) and null (e.g. every variable that has not been assigned to any value).


if('')  { x = 1; }
if(1-1) { x = 2; }
if(0.0) { x = 3; }
if(a)   { x = 4; }

Naming

Variable names can only consist out of letters (a-z, A-Z), numerals (0-9) and underscores ('_'). The first character numeral be a digit. They are case-insensitive (a == A is always true)


my_varIAble13 = 0;
___ = 'underscores';


2nd_var = 1.1;