/*
 * File: variables.txt
 * -------------------
 */

/* Store a number in one variable and a string in another. */
foo = 13;
bar = "Hello!";
wln("foo = " + tostring(foo));
wln("bar = " + bar);
wln();

/* JAIL is dynamically typed, meaning that a variable may switch type at any
   time. */
foo = "I'm a string now!";
bar = 37;
wln("foo = " + foo);
wln("bar = " + tostring(bar));
wln();

/* A variable can have an intrinsic value and sub-variables at the same time. */
foo = 13;
foo.name = "Marcus";
foo.pos.x = 3;
foo.pos.y = 8;
foo[2] = "weird";
foo[3] = 17;
wln("foo       = " + tostring(foo));
wln("foo.name  = " + foo.name);
wln("foo.pos.x = " + tostring(foo.pos.x));
wln("foo.pos.y = " + tostring(foo.pos.y));
wln("foo[2]    = " + foo[2]);
wln("foo[3]    = " + tostring(foo[3]));
wln();

/* To delete a variable and all its sub-variables, use delete. */
delete foo;
wln("foo       = " + tostring(foo));
wln("foo.name  = " + tostring(foo.name));

