Variables are a way to dynamically use information, let's take our previous example and say we want to output a variable.
printl(foo);
foo
is not a string, it's a variable, but if we run this code we will get an error, this is because we haven't set the variable to a reference yet.We use
:=
to declare a new variable, here we set the variable foo from the previous example to the string"bar"
.foo := "bar";
After a variable has been declared we use the token
=
to re-assign it, using:=
again would reset the declaration.foo = "Hello, World!";
Types are automatically assigned based on context, this brings us to our next lesson which will tell you about types.